Convert CASE WHEN logic from SQL to EXCEL

Viewed 29

I have a SQL query to determine whether a record is from a particular data company or not.

The SQL code goes like -

CASE WHEN COL_Category in ('A',B')
OR (COL_Name like  '%Apple%)
OR (COL_Name like  '%Ball%)
THEN 'YES'
ELSE 'NO'

And I am trying to get the logic to work in excel for the column "Yes/No?"

COL_Category COL_Name Yes/No?
A Apple Yes
B Cat Yes
C Dog No
C Apple Yes
D Cat No
1 Answers

I think I figured it out. Answering for future reference.

A combination of IF(), ISNUMBER(SEARCH()), and OR() can be used to achieve the result.

Find the screenshot here

Related