Joshua has attended:
Excel Introduction course
Excel Intermediate course
Excel Advanced course
Excel Formula to return text when a cell contains certain text
Good Morning
I am trying to think of a formula to perform the function of the above.
I am trying to group US states for example if a cell contains NC,SC or GA then then the answer will appear as South East.
Any thoughts of advise?
Thank you
Josh
RE: Excel Formula to return text when a cell contains certain te
Hello Joshua,
Thank you for your question. The best formula to achieve this is using XLOOKUP.
You can write it as follows:
=XLOOKUP(B2,$E$2:$E$51,$F$2:$F:$51)
where B2 (the lookup value) holds the state code in the line item, column E (the lookup array) holds all the state codes and column F (the return array) holds all the corresponding regions.
E F
NC South East
SC South East
NY North East
I hope this helps.
Kind regards
Marius Barnard
STL