How to Match Regions to States in a Column
I am creating a sheet that needs to identify the "region" based on the "state" in the preceding column. I've tried multiple formulas and get back an error message (unparseable). What am I missing?
=IF([State]1=ny,nj,ct, "northeast",IF([State]1=nc,sc,ga, "southeast", IF([State]1=ca, az, nv, "west")))
Best Answers
-
@Genevieve P Boom! That did it! Thanks so much for your help Genevieve
-
Glad you got it working!
I'd also recommend replacing the State1 with State@row instead so you don't have to think about row numbers + it doesn't take as many resources.
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
Answers
-
Hi Donna,
You're getting an #UNPARSEABLE error because you've entered text without quotes, shown in bold
=IF([State]1=ny,nj,ct, "northeast",IF([State]1=nc,sc,ga, "southeast", IF([State]1=ca, az, nv, "west")))
Putting those strings of text within quotes would make your formula run, but it would not work correctly because the formula will only return an exact match. If you put NY in the State column it won't display northeast because the formula is looking for an exact match of nj,nj,ct.
You need to rewrite the formula to look for the individual states, this is the formula that does that:
=IF(OR(State@row = "NY", State@row = "NJ", State@row = "CT"), "Northeast", IF(OR(State@row = "NC", State@row = "SC", State@row = "GA"), "Southeast", IF(OR(State@row = "CA", State@row = "AZ", State@row = "NV"), "West")))
You can see it here
School of Sheets (Smartsheet Partner)
If my answer helped please accept and react w/💡Insightful, ⬆️ Vote Up, ❤️Awesome!
-
Thank you!!!
-
Follow up - I've entered all 50 states and their respective regions following the above formula. I'm getting an "incorrect argument" message. Can you tell me how to address this?
-
To add to Dan's excellent suggestion.
Another option and the one I'd recommend would be to use a VLOOKUP or a combination of INDEX/MATCH instead and place the table in a separate sheet or the same in some hidden columns.
What do you think?
Would that work/help?
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please help the Community by marking it as the accepted answer/helpful. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
Thanks for the prompt reply, Andree and I appreciate your suggestion, but I'm brand new to SS and I don't have the luxury to start again (and I don't know how to work in VLookup). The formula provided is very workable, I just feel like either there are not enough (or too many) parentheses at the end of the formula or there are spaces where there shouldn't be...are you able to see where I've gone wrong here?
-
Happy to help!
I'd be happy to take a quick look.
Can you maybe share the sheet(s)/copies of the sheet(s)? (Delete/replace any confidential/sensitive information before sharing) That would make it easier to help. (share too, andree@getdone.se)
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
I haven't been able to write out your formula and test, but you'll want to make sure that you close off every OR statement before listing what the IF should return.
It looks like your first OR statement closes too early, there's a pink ) after "NH" instead of after "RI".
Then, none of the other OR statements have any closing parentheses before the value you want as a result.
Ex:
You should have a closing ) and comma after "DC", before "Midatlantic", like so: "DC"), "Midatlantic", IF(OR(... etc
Then again after "MS"), "Southeast"
Does that make sense? You have to tell the OR when to stop for each of your results.
Hope that helps!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Shared
-
Got it! Thanks very much
-
@Genevieve P I cleaned up a few of the items that you pointed out, it then reverted to #unparseable :-(
-
Hi Donna,
Try removing some of the end )))'s from the very last bit of the formula. See how some of them are black instead of a colour? The )s change colour depending on what they're matching with. You only need up until the last BLUE one, as that's matching with the very first open ( which is blue, at the beginning of the formula.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Genevieve P Boom! That did it! Thanks so much for your help Genevieve
-
Glad you got it working!
I'd also recommend replacing the State1 with State@row instead so you don't have to think about row numbers + it doesn't take as many resources.
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
Great! Glad you got it working!
@Andrée Starå 's advice about @row is really good, as well.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!