Search code examples
google-sheetsuniquetransposeflattengoogle-query-language

How Do I Exclude Certain Data Types in a Range in Google Sheets?


I've looked everywhere for this. I have a sheet that splits a message into columns. It goes something like this.

On the left column, the message to be split is placed. On the columns to the right the message is split so the person is in 1 column and their number is in the column to the right of that.

In another sheet, I have a UNIQUE() function to gather all the unique names but without the numbers. I do this by doing UNIQUE(FLATTEN()) and manually typing all the ranges that don't have the numbers. My question is: is there a way for me to instead of skipping the columns with numbers and stringing a bunch of ranges together, can I use one range that includes the numbers and the names but also ignores cells that are only numerical values?


Solution

  • try:

    =UNIQUE(QUERY(FLATTEN(C2:H), "where not Col1 matches '^\d.+'", 0))
    

    update:

    =QUERY(UNIQUE(FLATTEN(FILTER(LOGGING!D2:Z, 
     MOD(COLUMN(LOGGING!D2:Z), 2)=0))), "where Col1 is not null", )