Google Sheets – Return Cell Value if Cell Contains Specific Text

google sheetsgoogle-sheets-query

Look at the example I have below.

A-.375-VG-M761   
A-.375-VG-O630  
A-.375-VG-O780   
A-.75-VG-602     
A-.75-VG-603     
A-.75-VG-604    

In one column I have two "SKUs": A-.375-VG and A-.75-VG.
I want to use this data to separate these SKUs onto two specific tabs of the same sheet.
How do I search through a column and return a cell if it contains a certain string of text?

I've tried REGEXMATCH and FIND but neither of those seem to do the trick.

Best Answer

(Assuming your data is in column Z and cells 10-17).

Use this formula for A-.375-VG in one tab:

=QUERY(Z10:Z17,"SELECT Z where Z like 'A-.375-VG%' ")

and for A-.75-VG in the other

=QUERY(Z10:Z17,"SELECT Z where Z like 'A-.75-VG%' ")