IF with multiple choices dropdown list cell
Hello everyone!
English is a second language for me so please forgive my spelling mistakes in advance.
I have a form with a multiple choice dropdown that populates one of my columns in my sheet. I want to do an IF to give a rating based on the answers.
Here's what I got:
=IF([Question]@row = "answer1" and "answer2"); 0; IF([Question]@row = "answer1" and "answer3"; 0,5; IF([Question]@row = "answer1"; 1)))
I would like to add a ELSE like in VBA for the remaining combinations. Also the AND function doesn't work like that in Smartsheet, so I'm not sure how I should do it.
Thank you for your help!
Karl
Best Answers
-
My apologies. I got a little ahead of myself.
=IF(AND(HAS(Question@row; "answer1"); HAS(Question@row: "answer2")); 0; IF(AND(HAS(Question@row; "answer1"); HAS(Question@row; "answer3")); 0,5; IF([Question]@row = "answer1"; 1; "ELSE")))
-
You have a colon instead of a semicolon after the second "Question@row".
Answers
-
Try this...
=IF(AND(Question@row = "answer1"; Question@row = "answer2"); 0; IF(AND(Question@row = "answer1"; Question@row = "answer3"); 0,5; IF([Question]@row = "answer1"; 1; "ELSE")))
-
Hi Paul,
I tried with the layout you suggested, and a few variants, and here's the result:
Always write ELSE:
=IF(AND(Question@row = "answer1"; Question@row = "answer2"); 0; IF(AND(Question@row = "answer1"; Question@row = "answer3"); 0,5; IF([Question]@row = "answer1"; 1; "ELSE")))
Write nothing (and without the ELSE):
=IF(AND(Question@row = "answer1"; Question@row = "answer2"); 0; IF(AND(Question@row = "answer1"; Question@row = "answer3"); 0,5; IF(Question@row = "answer1"; 1)))
Write #UNPARSEABLE:
=IF(AND(Question@row = "answer1"; Question@row = "answer2"); 0; IF(AND(Question@row = "answer1"; Question@row = "answer3"); 0,5; IF(Question@row = "answer1"; 1; IF(Question@row = "ELSE"; 0.75))))
Do you know how I can make it work? I think we are close but I don't have enough experience with Smartsheet to know why it won't work.
Thank you,
Karl
-
My apologies. I got a little ahead of myself.
=IF(AND(HAS(Question@row; "answer1"); HAS(Question@row: "answer2")); 0; IF(AND(HAS(Question@row; "answer1"); HAS(Question@row; "answer3")); 0,5; IF([Question]@row = "answer1"; 1; "ELSE")))
-
Hi Paul, it still put me the word ELSE each time. I want to give a value when it's another answer. Here what I tried with your last comment:
=IF(AND(HAS(Question@row = "answer1"); HAS(Question@row = "answer2")); 0; IF(AND(HAS(Question@row = "answer1"); HAS(Question@row = "answer3")); 0,5; IF(Question@row = "answer1"; 1; IF(Question@row = "ELSE");0.75)))
It still won't work, (#UNPARSEABLE).
Thanks a lot for your help!
Karl
-
Are you updating "answer1" with the specific text that would be found in the cell? Same for "answer2" and "answer3"?
The last formula I posted should work as long as you have updated the "specific text" inside each of the HAS functions.
Additioanlly, the HAS functions should look like this:
HAS(Question@row; "answer1")
and not like this:
HAS(Question@row = "answer1")
-
Hi Paul,
I did a simplified test to make sure everything works (see screenshot), so the specific text is "Answer1", "Answer2, etc.
I corrected the HAS(Question@row = "answer1") for HAS(Question@row; "answer1"), but it still won't work... Did I forgot something?
Thank you,
Karl
-
You have a colon instead of a semicolon after the second "Question@row".
-
Thanks a lot! Everything is working fine now!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 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!