Using IF Statements in Excel with SUM formula

I have been having great difficulty in getting my formulae to work in Excel.

Basically I have an IF statement, like this:

In cell U5 :
=IF(K5="text","1","")

I had copied these all down to cell U500.

I then wanted to use SUM to combine all the numbers, so that I have a figure afterwards, like this:

In cell S5 :
=SUM(U5:U500)

I am getting a "0" in cell S5.

Why is this happening? I definitely have text in K column.

4

1 Answer

The issue is you're adding 1 to Excel as a string, not a number

You have

=IF(K5="text","1","")

You need

=IF(K5="text",1,"")

enter code here

Maybe having

=IF(K5="text",1)

is better, or

=IF(K5="text",1,0)

but depends on how you're using it else where.

Screen to prove it won't work if you add the number as a string (note in the image, the 5 in the formula is a string ("5")

enter image description here

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like