98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Excel Formula to return text when a cell contains certain text
Excel Formula to return text when a cell contains certain text
Resolved · Medium Priority · Version 365
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
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Line breaks in a cellYou can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it. |