Search code examples
regexgoogle-sheetsfiltergoogle-sheets-formulagoogle-sheets-query

How i can use query formula to get values if cell value conatin mention word in data?


I want to get values from one sheet to my other sheet. But want to fetch only values from Column A if value contains 202 value like bellow.

Column A     |             
===============
Hello        |          
World! 202   |        
Foo          |            
Bar 2021     |     

Now I want to get values only which contain 202 like bellow

in sheet 2 I want result like this

    Column A     |             
    ===============
    World! 202   |                      
    Bar 2021     |     

I try this formula but unable to get data

=iferror(query(Data!A:A, "where A CONTAINS =202,0),"no submition yet"))

Solution

  • Because the data is a string query is going to treat it as a string.

    =query(A:A, "where A CONTAINS '202'")
    

    You were missing the ' ' around the text 202 and also you have a lot of typos.