google-sheetsgoogle-sheets-formula

Searching for text in a column in google sheets, and determining if text exists in that range


I'm having a hard time finding a solution to what I think should be a relatively simply task. Please see attached example screenshot.

Screenshot of google sheet

What I want to do is: I have a "database" in column B. column A is a number that a user inputs. I want to check if the user input exists in the database, and if it does, I simply want the column next to the database to say "Yes" or "No".

Columns D and E are my attempts at this.

VLookup works ok, but this is not the response I want. I want "Yes" or "No".

I tried an IF Statment, but I get an error "In Search Evaluatio, cannot find '5' within '1'.


Solution

  • Try this formula-

    =IF(ISNUMBER(XMATCH(A1,B:B)),"Yes","No")