+ Reply to Thread
Results 1 to 5 of 5

new to excel programming, why is this happening?

  1. #1
    Registered User
    Join Date
    04-07-2012
    Location
    Raleigh, NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    new to excel programming, why is this happening?

    I'm typing a simple IF function but I keep getting an error that I have too many arguments in one function.

    =IF(J3 > 0,J3,(C3-(C3*H3)),IF(H3= 0,C3,(C3-(C3*H3))))

    Thanks :D

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: new to excel programming, why is this happening?

    yes, that's because you have too many arguments in your function!!

    The if function is in the form =if(test,answer if true, answer if false). i.e. only 3 arguments. You have 4 arguments. So delete the argument starting with the comma before the last IF statement, and it will work - i.e. it will have 3 arguments.

    Now I am sure somehow you want the last If statement, but that is a different question, and you need to be specific about what you are trying to do.

  3. #3
    Registered User
    Join Date
    04-07-2012
    Location
    Raleigh, NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: new to excel programming, why is this happening?

    Thank You Mallcat,

    Yes I do want the other function, How do I do that? Also why does this function work? : =IF(G3 <=8,0,IF(G3 <=14,0.15,IF(G3<=18,0.25,IF(G3 > 18,0.4)))) I am surely using more than three arguments right?

    Thank You.

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: new to excel programming, why is this happening?

    Because in the one you have just posted, the "answer if false" augment has been replaced with a second if statement. In your original formula, you added a fourth argument. you can keep nesting if statements as long as you replace one of the arguments with an entirely new (and complete) if statement.

  5. #5
    Registered User
    Join Date
    04-07-2012
    Location
    Raleigh, NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: new to excel programming, why is this happening?

    Got it!

    Thanks Mallycat!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1