excel_noob
excel_noob

Reputation: 63

Convert CASE WHEN logic from SQL to EXCEL

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

Upvotes: 1

Views: 185

Answers (1)

excel_noob
excel_noob

Reputation: 63

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

Upvotes: 1

Related Questions