Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.

Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Numbers - filter multiple values in a single column

I want to filter rows that have different values in the same column. One value works, but not several. Notice that while I have both Rock and Synth Pop selected out. I still have them showing in the column:


I have also tried combinations of text "does not contain" and creating a separate filter (as opposed to "OR". This does not work either. To be clear what I am trying to do is see all columns that do not have the values of "Rock" or Synth PoP" in the Column "Genre".


iMac Pro

Posted on Jul 11, 2020 1:33 PM

Reply
11 replies

Jul 12, 2020 7:05 PM in response to JonS.

HI Jon,


"I think, match any filters is what should work, but match all is what gives the desired result...."


That depends on the construction of the filters.


(Show rows that) match ALL filters does what it says:

  • Rows containing "Rock" are not shown because they do not match Filter 1.
  • Rows containing "Synth Pop" are not shown because they do not match Filter 2.
  • All other rows match Filter 1 because they do not contain "Rock" AND match Filter 2 because they do not contain "Synth Pop". They are shown because they match all filters.


Regards,

Barry

Jul 12, 2020 10:54 AM in response to Barry

I am sorry but that does not work for me. It may be Numbers does not do - hide the selected items. When I put in Rock as the single entry, I get the expected result (when I say text does not contain). That is, rows with Rock are not shown. This result is the same whether I use Match All or Match Any filters. When I add Synth Pop as shown below with match any or match all. Both Synth Pop and Rock show. This is very counter intuitive. It is impractical in some columns to list all the things you want to reveal and enter them since the list is long. I am sorry but this is still not quite right from what I can tell. It neither shows only the results requested or hides them. In the second image, when just classical was put in. All I saw were rows of classical. When I added Folk, Folk never showed. Sorry if I am still missing something.

Jul 12, 2020 11:58 AM in response to JonS.

Hi Jon,


I think I've discovered where it's going wrong.


I am assuming the only difference between the two cases shown in your most recent post is the "Match Any Filters" "Match All Filters" setting (missing from the first image).


Either of these settings will produce the same result, because you have specified only ONE Filter.

If "Any" filter in a set of one is matched, then All filters in that set of one are matched


The ONE Filter in your examples consists of two rules, connected by "or" If either rule returns 'true', then the Filter condition is met.


Put each rule into a separate Filter, set the Match menu to Match All Filters, as shown below.



When the filter is activated (Checkbox to right of "Filters") this result is seen (note missing row numbers in the reference tabs left of the table):


Regards,

Barry



Jul 12, 2020 11:49 PM in response to JonS.

Regarding: "[T]here appears to be a limit of about 8 filters then the option to create another is greyed out "


Here's an alternate that could get you past the eight filter limit.



This version uses a single Filter, with a single rule: Show this row if the cell in column F contains "show"


The harder part i getting that cell to show "show"


To the right of the main table is a second table containing two columns and enough rows to handle as many genres as you have named. For the example, that is 15 genres, listed on if copies of a pop-up menu cell in column 1.


The first cell (A2 contains an extra menu item—All—making it easy to display all rows without having to set each menu to one of the genres.


In the image above, A2 is set to All, and the rest of the cells are set to "xxxxxxxxx" (nine x characters)


Here is the simple Filter rule used in this solution.



In the image below, three of the pop-up menu cells have been set to three different genres. Noe that it is not necessary that the hree set menus be in contiguous rows be three contiguous cells. Note also that the Text string cell contains a single string of the three genres that have been selected on three of the pop-up menu cells.


Since the filter is active, we see only rows containing one of the selected genres (and the text "show". in column E. (Column D has been hidden to take less space).)



The formula below the tables is entered in cell B2 of the second table. Its purpose is to create the Test string in that cell.


In this formula, CONCATENATE joins the string values displayed in the pop-up menus in cells A2 to A16 of this table into a single string will no spaces other than those in the genre names.


SUBSTITUTE then replaces each group of "xxx" with a null string, removing all the 'x" characters set by the pop-up menus set to xxxxxxxxx. he result is a string containing only the names of the genres selected to show.


In the image below, the formula shown near row 12 of the table is entered in cell E2 of the main table, and filled down to the last row containing an entry.




IF All is selected in the first pop-up menu in Table 2, the first conparison returns 'true', making OR return 'true', and IF places the text 'show' in this row of column E.

If All is not selected, OR evaluates the second comparison: LEN(Table 2::B$2)>LEN(SUBSTITUTE(Table 2::B$2,B2,"")

LEN measures the length of a string in characters. Substitute looks for a string of characters (in this case, the text in B2 or 'this table' in the test string, and if it finds that string, replaces it with a null string. This shortens the original string, making it's measurement by LEN shorter than the original. The comparison returns 'true', OR returns 'true', and IF places 'show' in the cell containing the formula.


Is the text in B2 of this table is not found in the test string, no substitution is made, the length of the string remains the same, IF receives 'false' from the comparison, no change in made in the LENgth of the test string, and IF places "hide" in the cell.


As column E is filled with "show" or "hide", the single filter immediately shows rows containing "show" and hides those that do not show "show".


REgards,

Barry

Jul 13, 2020 2:11 AM in response to JonS.

Hi Jon,


Another approach (standing on the shoulders of giants Badunit and Barry).

Formula in C2 of the List table =VLOOKUP(B2,Selector::A:B,2)


Formula in D2 of the List table =IF(Show All::A$1,"Show",IF(C2=TRUE,"Show",""))

Fill both formulas down.

Filter the List table by column D (Text is Show).


The Show All table is your panic button.


Regards,

Ian.

Jul 11, 2020 6:05 PM in response to JonS.

Hi Jon,


Filters determine which rows to Show, not which to hide.


With the control set to "match any filter" only one filter's condition needs to be met for the row to be shown.


Synth Pop and Synth are shown because they 'are not Rock' and match the first filter.


Rock is shown because it 'is not Synth' and matches the second filter.


The third filter is never called on because the only genre that won't match the first filter is Rock, and that genre will be approved by the second filter.


Switch that to "Match all filters" and you'll get the results you want.


Regards,

Barry


PS: Essentially the same asnwer as presented by Badunit's illustration.

Jul 12, 2020 11:35 AM in response to JonS.

Did the filter I posted work for you?


Your filter, as described in plain text, is "Show rows where genre is not rock OR genre is not synth pop".

Let's try an example row and see what should logically happen. Let's say a row has the genre "rock":

"is not rock" = FALSE

"is not synth pop" = TRUE

OR(FALSE,TRUE) = TRUE

Since the result is TRUE, the row will be shown.


The filter I provided is two filters that must both be met.

"is not rock" = FALSE

"is not synth pop" = TRUE

AND(FALSE, TRUE) = FALSE

Since the result is FALSE, the row will not show

Jul 12, 2020 1:12 PM in response to Badunit

Hi I think this is about where we ended up with Barry.


Thanks so much. This is much closer to what I need, though there appears to be a limit of about 8 filters then the option to create another is greyed out. For most things I want this will work. I also noticed our UIs are different. I don't have a checkbox for filters on my application. Notice I have a slider on top. There is also a logic problem I have. I think, match any filters is what should work, but match all is what gives the desired result....


Thanks for the help. I have to look at Categories, but for text fields, I don't see how to make that work.

Jul 30, 2020 12:11 PM in response to Yellowbox

Hi everyone,


First, I want to thank you for all the detailed and helpful replies. The issue with the last couple of posts, unless I misunderstand, is that they assume the vlookup/show column values are static. Whether I want to see or not see a genre or set of genres depends on what I am looking for, or am going to work on. Since this varies I would have to be tweaking these solutions each time I change my mind about what I want to see. Creating the filters and modifying the values of TRUE/FALSE on about 5,000 rows would be a lot of work.


While I am at it, it appears as if I can not save/name a filter. That would be a nice feature.


In the end, I think I should be doing this in a DB where I could create 10 or so queries one time that would meet most of my needs, or do this ad hoc. Setting on up and using say LibreOffice is quite easy, but this tool and the OpenOffice predecessor are so buggy as to be unusable.


Tools like MariaDB or any of the NoSQL alternatives would work well, but with much more work on my part. Once I get the data cleaned up, which is a big job, I might output to a CSV file each time I add new information in the spreadsheet, and do my searches on the CSV file with native unix tools on the Mac. Basics like grep to writing some perl scripts. There may not be any other way.


Other suggestions?

Numbers - filter multiple values in a single column

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.