Forum Discussion
RebeccaA
Oct 31, 2019Copper Contributor
Nested "if" Excel 2007
Losing. My. Mind.
I need to assign a region to each row of a spreadsheet based on the state listed in it.
Let's say B1 is the state name.
A1 needs to sort those states into North, South, East, West.
Formula:
=IF(B1=California,"West",IF(B1=New York,"East",IF(B1=Minnesota,"North",IF(B1=Texas,"South"))))
(Hugely simplified for this post).
The result is: #NAME?
Where am I going wrong?
4 Replies
- tauqeeracmaIron Contributor
Hi RebeccaA
Your formula is correct you simply missed out "". Please use below
=IF(B1="California","West",IF(B1="New York","East",IF(B1="Minnesota","North",IF(B1="Texas","South"))))
Thanks
Tauqeer
- RebeccaACopper ContributorUnbelievable. All these hours and that was it. Thank you. THANK YOU!!!
- TwifooSilver ContributorAnother CHOICE would be:
=CHOOSE(MATCH(B1,
{“California”,”Minnesota”,
“New York”,”Texas”},0),
“West”,”North”,”East”,”South”)
LOOK no further, I prefer:
=LOOKUP(B1,
{“California”,”Minnesota”,
“New York”,”Texas”},
{“West”,”North”,”East”,South”})