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

lordbyron1814

New Member
Joined
Mar 25, 2002
Messages
3
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?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Thank you- I removed the =sum from the formula. however the math is still not being done. something else must be wrong...
 
Upvote 0
Hi
Doublecheck everything.

The formula given by Juan Pablo G. is correct.

Tom
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,184
Members
448,949
Latest member
keycalinc

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top