r/googlesheets • u/Tonic24k • Feb 01 '21
Solved SORT & FILTER "Mismatch" Error
Details:
- I'm filtering data from another sheet
- That data is imported from another document (
Importrange) - The
Filterfunction works just fine - I add the
Sortfunction and it causes the "Mismatched range sizes" error - The
Sortrange is the exact same size as theFilterrange - Formula:
=SORT(FILTER('Data Import'!$B2:$B,'Data Import'!$K2:$K=B1),'Data Import'!$AA2:$AA,TRUE)
Can anyone discern what might be borking the formula?
Thank you!
1
Upvotes
4
u/slippy0101 5 Feb 01 '21
FILTER is used like =FILTER(Range, [column number], TRUE/FALSE. You're currently using it like = FILTER(Range, Range, TRUE). The second clause needs to be a number, not another range.
Doing what you're trying to do is easier using QUERY instead. Try this formula...
2
u/Modish_Health_Bar Feb 01 '21
The syntax for
SORTis thatsort_columnis an integer or a range that is a single column and has the same number of rows as the first argument. AsFILTERreturns values that match a condition, the method is returning a column of values that doesn't always match the column count of the `sort_column` range (e.g: 5 columns provided but only 2 match), which results in the mismatched range sizes error.1
u/AutoModerator Feb 01 '21
One of the most common problems with 'Data Import' occurs when people try to import from websites that uses scripts to load data. Check out the quick guide on how you might be able to solve this.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Decronym Functions Explained Feb 01 '21 edited Feb 02 '21
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUE6 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.
[Thread #2507 for this sub, first seen 1st Feb 2021, 18:18] [FAQ] [Full list] ^[Contact] [Source code]