Forum Discussion

MattSmith1375's avatar
MattSmith1375
Copper Contributor
Apr 09, 2024

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?

 

DataOutput List
ALDI STORES - NORTH RY   NORTH RYDE AUGroceries Aldi
Brewscape Cafe ForestvillRHODES       AUNil Coles
COLES 5791               MACQUARIE PK AUNil Woolworths
CarnivalFunPass          CARNEGIE     AUNil  
WOOLWORTHS/TOP RYDE CITY RYDE         AUNil  

 

  • MattSmith1375 

    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.

  • MattSmith1375 

    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.

Resources