Google sheets, if statement multiple conditions

Bret Allan picture Bret Allan · Nov 15, 2017 · Viewed 40.9k times · Source

Trying to make an if statement that will return 4 outcomes based on the contents of the cell

If the cell is "Yes", "No", "NA", "Unknown", to return 0, 1, 2, 3 respectively.

I can use If(A1="Yes", 0,1) but not sure how to handle the other conditions

Answer

TheMaster picture TheMaster · Nov 15, 2017

SWITCH would be a better call:

=SWITCH(A1,"Yes",0,"No",1,"N/A",2,"Unknown",3,"I'-'I")