what if formula excel

%3CLINGO-SUB%20id%3D%22lingo-sub-1150384%22%20slang%3D%22en-US%22%3Ewhat%20if%20formula%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1150384%22%20slang%3D%22en-US%22%3E%3CP%3Ei%20need%20a%20formula%20which%20says%20the%20following%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20cell%20x%20%3D30%26nbsp%3B%20then%20return%20a%20value%20in%20cell%20reference%20a28%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20cell%20x%20%3D60%20then%20return%20a%20value%20in%20cell%20reference%20b28%3C%2FP%3E%3CP%3Eif%20cell%20x%20%3D%2090%20then%20return%20a%20value%20in%20cell%20reference%20c28%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20neither%20of%20those%203%20conditions%20are%20met%20then%20return%20value%200%20zero%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1150384%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1150415%22%20slang%3D%22en-US%22%3ERe%3A%20what%20if%20formula%20excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1150415%22%20slang%3D%22en-US%22%3ETry%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DSWITCH(cell%20x%2C%2030%2C%20A28%2C%2060%2C%20B28%2C%2090%2C%20C28%2C%200)%3CBR%20%2F%3E%3CBR%20%2F%3EOr%20for%20older%20Excel%20versions%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIF(cell%20x%20%3D%2030%2C%20A28%2C%20IF(cell%20x%20%3D%2060%2C%20B28%2C%20IF(cell%20x%20%3D%2090%2C%20C28%2C%200)))%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

i need a formula which says the following 

 

if cell x =30  then return a value in cell reference a28 

if cell x =60 then return a value in cell reference b28

if cell x = 90 then return a value in cell reference c28

 

if neither of those 3 conditions are met then return value 0 zero 

1 Reply
Highlighted
Try:

=SWITCH(cell x, 30, A28, 60, B28, 90, C28, 0)

Or for older Excel versions:

=IF(cell x = 30, A28, IF(cell x = 60, B28, IF(cell x = 90, C28, 0)))