If/Then Logic - Based on What Letter a Name Starts With
I am trying to create the following logic in Smartsheet
If Name starts with A through J, THEN Column A = Project Manager A
If Name starts with K through N, THEN Column A = Project Manager B.
Excel has this =CHOOSE(MATCH(UPPER(LEFT(A2)),{"A","K","O"}),"Project Manager A","Project Manager B","Project Manager C)
Best Answer
-
Thanks @Genevieve P. , That would work but then I would have to hard code the whole ABC.
I ended up using a match formula to reference another sheet where I had the ABC running down one column and referenced the range (in ABC List Range 1 from Letters A- J), if no match then I knew it would be Manager B. This worked great!
=IFERROR(IF(MATCH(LEFT(fullname@row), {ABC List Range 1}, 0) > 0, "Manager A", ""), "Manager B")
Thanks.
Answers
-
Hi @ygoldgrab
There may be a more succinct way of doing this, but what I would do is build out an IF statement that uses IF(OR to list all the possible options per-output.
We can use LEFT(Name@row) to get the first letter, then check which one it is. So, if you were to look for A, B, and C, you could do this:
=IF(OR(LEFT(Name@row) = "A", LEFT(Name@row) = "B", LEFT(Name@row) = "C"), "Project Manager A")
You would then just need to list all the LEFT(Name@row) = for each of your options. Then you can move on to the next IF statement if it's none of those:
=IF(OR(LEFT(Name@row) = "A", LEFT(Name@row) = "B", LEFT(Name@row) = "C"), "Project Manager A", IF(OR(LEFT(Name@row) = "K", LEFT(Name@row) = "L", LEFT(Name@row) = "M"), "Project Manager B"))
Let me know if this makes sense!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Thanks @Genevieve P. , That would work but then I would have to hard code the whole ABC.
I ended up using a match formula to reference another sheet where I had the ABC running down one column and referenced the range (in ABC List Range 1 from Letters A- J), if no match then I knew it would be Manager B. This worked great!
=IFERROR(IF(MATCH(LEFT(fullname@row), {ABC List Range 1}, 0) > 0, "Manager A", ""), "Manager B")
Thanks.
-
Ah, that's a much cleaner way of doing it, great idea. Thanks for sharing!
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.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 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!