Using IF statement to perform SUM or insert pre-defined stat
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

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

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

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

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

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

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Doublecheck everything.

    The formula given by Juan Pablo G. is correct.

    Tom

  6. #6
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,778
    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)

    Default

      
    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

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com