Skip to main content
Solved

How assign a number to a single selection value

  • February 16, 2023
  • 8 replies
  • 122 views

Forum|alt.badge.img+1

Hello everyone,

I am new to airtable. I have a survey and each question has a single select field option for the answers with a certain amount of points. How can I assign a number to each single select field value e.g. a=0, b=1, c=2 and d=3 so I can add up these points.

Hope to hear from you.

Thanks 

 

Best answer by Christian_Sabou

It's a pleasure! Please mark this post as solved 🙂

8 replies

Forum|alt.badge.img+5

This will require an additional Function field with a switch statement:

 

 

SWITCH({Answer field},"Answer one",1,"Answer two",2,0)

 

 

The last 0 being the default value if nothing is selected


Forum|alt.badge.img+1
  • Author
  • New Participant
  • February 16, 2023

Hi Christian,

Thank you for the quick response. I tried it and I get an error prompt (see attached file). Am I missing something?

 

 


Forum|alt.badge.img+5

You are missing the end parenthesis. The hint is the little squiggly line under the front one. Otherwise it should work.


Forum|alt.badge.img+1
  • Author
  • New Participant
  • February 16, 2023

You are missing the end parenthesis. The hint is the little squiggly line under the front one. Otherwise it should work.


Now with the end parenthesis added it does not seem to work.

 


Forum|alt.badge.img+5

Oh, It's the closing bracket that's extra now. 

SWITCH({Answer field},"Answer one",1,"Answer two",2,0)

Forum|alt.badge.img+1
  • Author
  • New Participant
  • February 16, 2023

Yes! It works! Thank you so much Christiaan. 

Regards,

Jerrel

 


Forum|alt.badge.img+5

It's a pleasure! Please mark this post as solved 🙂


Forum|alt.badge.img+1

It's a pleasure! Please mark this post as solved 🙂


Hi, 

Is it possible to add multiple columns to the SWITCH formula to have a sum of single select columns that have the same options and points?