# Solved Adding the if statement i always get zero (ms excel 2007)

August 20, 2012 at 23:21:04
Specs: Windows XP
 HOW CAN I PROBABLY GET THE SUM OF THE 2 IF STATEMENT?MY IF STATEMENTS:=IF(A1=90,"1","0") MEANS THE STATEMENT SHOWS 1 IF IT IS CORRECT "0" IF WRONG=IF(A2=40,"1","0") MEANS THE STATEMENT SHOWS 1 IF IT IS CORRECT "0" IF WRONGAND IF I ADD THE 2 IF STATEMENT ITS ALWAYS SHOW 0 =SUM(A3,A4) I NEED IT TO BECOME 2 BECAUSE 1 + 1 = 2 :D BUT I ALWAYS GET 0I ALREADY ANSWER IT CORRECTLY???SORRY FOR MY BAD ENGLISH... HOPE YOU CAN HELP ME....

See More: Adding the if statement i always get zero (ms excel 2007)

#1
August 21, 2012 at 06:31:01
 When you put the quotes around the "1" and "0", Excel interprets them as text values, not numbers.Some mathematical functions will work with text, others won't.For example, using your formulas, =SUM(B1:B2) will return 0, but =B1+B2 will return 2.To ensure that all mathematical functions will work, remove the quotes.=IF(A1=90,1,0)Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions