Skip to main content

Isssue with Switch formula for simple yes/no question

  • March 18, 2021
  • 3 replies
  • 26 views

AirTable Communityc,

I am trying to find a simple way to score a “yes/no” question. I need to say that a yes answer is equal to a “1” and a “no” answer is equal to a “0”

I was using the switch formula but I cannot formulate it correctly. I also tried an “IF” formula without success. Thoughts? Here is my formula:

SWITCH({Aircraft - Is all equipment secured appropriately in the main cabin and the aft compartment?},
yes, ‘1’,
no, ‘0’,
‘0’
)

Thanks in advance!

3 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • March 19, 2021

A SWITCH is overkill in this situation. An IF statement will work, but it needs to be structured correctly.

When you have a text string, like the word yes put it in straight quotes. When you want a number like 1 or 0, do not use quotes.

IF(
  {Aircraft - Is all equipment secured appropriately in the main cabin and the aft compartment?} = "yes", 
  1, 
  0
)

  • Author
  • New Participant
  • March 19, 2021

Thanks so much for your help. I am still unable to get the correct result but it did confirm the structure.

Do you see what I am doing wrong? I get the default = 0 for all the yes answers. The question is a single select question.


  • Author
  • New Participant
  • March 19, 2021

Thanks so much for your help. I am still unable to get the correct result but it did confirm the structure.

Do you see what I am doing wrong? I get the default = 0 for all the yes answers. The question is a single select question.


I figured it out. Spelling was an issue - must match the spelling exactly. Thanks so much for all your help.