Forum Discussion
Formula not working - Return value in cell if another cell contains text from a list
I am trying to get a formula that would evaluate the cells in the column 'data' to see if they contain any of the words contained in the column 'List', then if true return the word "Groceries" or otherwise leave the cell blank in the 'Output' column. The formula I am using seems to work for the top cell only.
=IF(OR(COUNTIF(A2,"*"&$D$2:$D$4&"*")), "Groceries", "Nil")
Can anyone help?
Data | Output | List | |
ALDI STORES - NORTH RY NORTH RYDE AU | Groceries | Aldi | |
Brewscape Cafe ForestvillRHODES AU | Nil | Coles | |
COLES 5791 MACQUARIE PK AU | Nil | Woolworths | |
CarnivalFunPass CARNEGIE AU | Nil | ||
WOOLWORTHS/TOP RYDE CITY RYDE AU | Nil |
Your formula works in my Excel 2013 when it's entered as an arrayformula with ctrl+shift+enter. If we don't work with Office 365 or Excel for the web we have to enter arrayformulas with ctrl+shift+enter.
- OliverScheurichGold Contributor
Your formula works in my Excel 2013 when it's entered as an arrayformula with ctrl+shift+enter. If we don't work with Office 365 or Excel for the web we have to enter arrayformulas with ctrl+shift+enter.
- MattSmith1375Copper ContributorIt worked! Thank you Oliver!