Thanks:  0
Likes:  0

# Thread: Using IF statement to perform SUM or insert pre-defined stat

1. If I type the letter "E" into J1 I want Excel to perform the auto sum feature. if there isn't an "E" in that box I want a number "0"

using this formula I was able to achieve half of that...

=IF(J1="E","=SUM(K1*C8)",0)

the "O" appears when it isn't an "E"

however if it IS an "E" I get the typed out "=sum (k1*c8)".

How do I force excel to do the math?

2. Change that to

=IF(J1="E",K1*C8,0)

There's no need for the SUM function there, since you're only giving it one parameter.

3. Thank you- I removed the =sum from the formula. however the math is still not being done. something else must be wrong...

4. I forgot to remove the parenthesis! thank you- It works! You've saved me 3 hours of re-occuring work!

5. Hi
Doublecheck everything.

The formula given by Juan Pablo G. is correct.

Tom

6. On 2002-03-26 12:33, lordbyron1814 wrote:
I forgot to remove the parenthesis! thank you- It works! You've saved me 3 hours of re-occuring work!

I think Juan would want to edit what he suggested

=IF(J1="E",K1*C8,0)

to the shorter:

=(J1="E")*(K1*C8)

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•