Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: IF Function: Too Many Arguments

  1. #1
    Join Date
    6th September 2006
    Posts
    25

    IF Function: Too Many Arguments

    Hi all,

    Here's my dilemma:

    VB:
    =If(RIGHT(Matrix,5)="10000",K451*(Y451/365),If(RIGHT(Matrix,5)="01000",K451+L451*(Y451-(365*2)/365),If(RIGHT(Matrix,5)="00100",K451+L451+M451*(Y451-(365*3)/365)),If(RIGHT(Matrix,5)="00010",K451+L451+M451+N451*(Y451-(365*4)/365),If(RIGHT(Matrix,5)="00001",(K451+L451+M451+N451)+(O451*((Y451-(365*4))/365))))))) 
    
    
    As you can see, it's a 5x5 matrix and values on this particular cell need to follow the formula seen in the code. The problem is that I can only get to a the third condition (00100) before Excel stops and tells me that I have entered too many arguments into the equation.

    Would it help if I were to do the calculations on another cell and then just reference the equation there?

    For example, I would move the formula:"K451*(Y451/365)" and the other subsequent formulas to other columns and then have the code above choose the proper value off those columns.

    i.e.
    VB:
    =If(RIGHT(Matrix,5)="10000",Z451,) 
    
    
    Thanks in advance!

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    25th April 2006
    Posts
    890

    Re: If Statement Too Many Arguments

    You had one to many parentheses after the third statement. Basically, you had a complete if statement nested within other if statements.

    Try this

    VB:
    =If(RIGHT(Matrix,5)="10000",K451*(Y451/365),If(RIGHT(Matrix,5)="01000",K451+L451*(Y451-(365*2)/365),If(RIGHT(Matrix,5)="00100",K451+L451+M451*(Y451-(365*3)/365),If(RIGHT(Matrix,5)="00010",K451+L451+M451+N451*(Y451-(365*4)/365),If(RIGHT(Matrix,5)="00001",(K451+L451+M451+N451)+(O451*((Y451-(365*4))/365))))))) 
    
    

    Excel Video Tutorials / Excel Dashboards Reports


  3. #3
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,698

  4. #4
    Join Date
    6th September 2006
    Posts
    25

    Re: If Statement Too Many Arguments

    Ah I see, thanks for spotting the error bryce. Ty also dave for the input, I actually was reading up on that when searching through the forums.

    Seems like it works now. Thank you!

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Too Many Arguments In IF Function
    By sac1973 in forum EXCEL HELP
    Replies: 6
    Last Post: February 15th, 2008, 10:23
  2. Display Function/Formula Arguments
    By DavidC123 in forum EXCEL HELP
    Replies: 1
    Last Post: October 4th, 2007, 10:14
  3. Too Many Arguments With If Function
    By h4x3r in forum EXCEL HELP
    Replies: 4
    Last Post: January 2nd, 2007, 10:22
  4. Replies: 2
    Last Post: March 9th, 2006, 08:37
  5. unlimited arguments in a function
    By Vurdy in forum EXCEL HELP
    Replies: 2
    Last Post: January 18th, 2005, 08:29

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
  •  
porno