Kristan Servidad
Kristan Servidad

Reputation: 45

How to Select Rows Using Query Where Cells Contain Text

I'm using a query function to copy over rows if it contains any text and/or numbers from column 12 (this column contains addresses). Column 12 has blank cells at times, so I would only like to copy over the entire row only if there's an address listed in this column. I've seen formulas where it's written to pick up on specific words, but not for a series of any numbers and letters in general.

Here's what I have so far:

=QUERY(QUERY('Zapier Tax Leads'!$A$2:$AQ$100000000,"SELECT A, B, C, D, E, F, G, H, I, J, K",1), "SELECT * WHERE Col12 contains "TEXT",1")

I'm getting a Formula parse error. which I am assuming it's coming from the "SELECT * WHERE Col12 contains "TEXT" part.
Any suggestions?

Upvotes: 1

Views: 6331

Answers (1)

marikamitsos
marikamitsos

Reputation: 10573

EDIT (following OP's comment)

Can we add to this function and use other columns? i.e. "WHERE L & A & B is not null"

Yes you can.
Pay attention to the syntax though.
WHERE L is not null and A is not null and B is not null
Meaning, you have to use is not null for each column you wish to use it for.

Please read more about the where clause


What you (probably) need is the following formula

=QUERY('Zapier Tax Leads'!A2:Z,"SELECT A, B, C, D, E, F, G, H, I, J, K WHERE L is not null",1)

WHERE L is not null means that the query will only bring rows when there is some value in rows in column L.
In other words, it will bring rows that are NOT empty.

(Please adjust ranges to your needs.)

Upvotes: 2

Related Questions