I've entered too many arguments for function
Results 1 to 7 of 7

Thread: I've entered too many arguments for function
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Dec 2018
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default I've entered too many arguments for function

    Can someone please take a look at this formula and help me figure out what is wrong or maybe a better way to accomplish this? Thanks.

    =IF(AND(D13<$A$5, Recruitment_Package!$I$9={"In Bank Footprint"}), (D13*$B$5)/10000, (D13*$D$5)/10000,
    IF(AND(D13<$A$6, Recruitment_Package!$I$9={"In Bank Footprint"}), (D13*$B$6)/10000, (D13*$D$6)/10000,
    IF(AND(D13<$A$5, Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$B$7)/10000, (D13*$D$7)/10000,
    IF(AND(D13<$A$8, Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$D$8)/10000,(D13*$D$8)/10000,
    IF(AND(D13<$A$9,Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$B$9)/10000, (D13*$D$9)/10000 )))))

  2. #2
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    3,826
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

    Default Re: I've entered too many arguments for function

    could you explain what's the formula supposed to do?

  3. #3
    Board Regular
    Join Date
    Jan 2014
    Location
    Dublin, Ireland
    Posts
    1,421
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: I've entered too many arguments for function

    in all of your IFs you are providing logic, false values and true values. you cannot then add another IF to the end as you have run out of arguments.

    something like
    =
    IF(AND(D13<$A$5, Recruitment_Package!$I$9="In Bank Footprint"), (D13*$B$5)/10000, (D13*$D$5)/10000)&IF(AND(D13<$A$6, Recruitment_Package!$I$9="In Bank Footprint"), (D13*$B$6)/10000, (D13*$D$6)/10000)&
    IF(AND(D13<$A$5, Recruitment_Package!$I$9="In Bank Footprint"),(D13*$B$7)/10000, (D13*$D$7)/10000) &
    IF(AND(D13<$A$8, Recruitment_Package!$I$9="In Bank Footprint"),(D13*$D$8)/10000,(D13*$D$8)/10000)&
    IF(AND(D13<$A$9,Recruitment_Package!$I$9="In Bank Footprint"),(D13*$B$9)/10000, (D13*$D$9)/10000 )

    would work but it will just give you back to back numbers. it really depends on what you are trying to achieve, which you need to tell us.
    Learn something new everyday.

    be sure to use code tags

    Code:
    [ code ]
    [ / code ]
    ' no spaces

  4. #4
    Board Regular
    Join Date
    Dec 2017
    Location
    UK
    Posts
    817
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)

    Default Re: I've entered too many arguments for function

    One way of simplifying equations is to look to see what is common and move to the "outside" if statement. what is common between all the "and" statements is:
    Recruitment_Package!$I$9={"In Bank Footprint"}
    So you could move this check to an "if" statement surrounding all the other checks, so you only do it once.
    I can't help further because as the others have said we don't know what you are trying to do.
    Speed up your code use variant arrays and NEVER ACCESS THE WORKSHEET IN A LOOP

  5. #5
    New Member
    Join Date
    Dec 2018
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Re: I've entered too many arguments for function

    [QUOTE=jricks;5195111]Can someone please take a look at this formula and help me figure out what is wrong or maybe a better way to accomplish this? Thanks.

    =IF(AND(D13<$A$5, Recruitment_Package!$I$9={"In Bank Footprint"}), (D13*$B$5)/10000, (D13*$D$5)/10000,
    IF(AND(D13<$A$6, Recruitment_Package!$I$9={"In Bank Footprint"}), (D13*$B$6)/10000, (D13*$D$6)/10000,
    IF(AND(D13<$A$5, Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$B$7)/10000, (D13*$D$7)/10000,
    IF(AND(D13<$A$8, Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$D$8)/10000,(D13*$D$8)/10000,
    IF(AND(D13<$A$9,Recruitment_Package!$I$9={"In Bank Footprint"}),(D13*$B$9)/10000, (D13*$D$9)/10000 )))))

    To explain what I'm trying to do:
    I have a list of values in A5, A6, A7, A8, and A9(500,001 750,001 1,000,001 1,500,001 and>1,500,001)
    I want to look at the number in D13 and see if it is < those value and keep looking until it falls in one of those categories.
    There are also the condition that if a drop down is selected "In Bank Footprint" then it will calculate D13*B5/1000, but if not then calculate D13*D5/10000 and so on. Hope that helps and makes sense.

  6. #6
    Board Regular
    Join Date
    Dec 2017
    Location
    UK
    Posts
    817
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)

    Default Re: I've entered too many arguments for function

    If you change the list of numbers in A5 to A9 to include a zero first going up to 1500000, then this code should do what you want:
    Code:
    =INDEX(B5:D9,MATCH(D13,A5:A9,1),IF(Recruitment_Package!$I$9={"In Bank Footprint"},1,3))
    Note, I can't test your "Recruitment_Package!$I$9={"In Bank Footprint"}" statement so I don't know whetehr that will work, the curly brackets??
    Last edited by offthelip; Dec 19th, 2018 at 10:44 AM.
    Speed up your code use variant arrays and NEVER ACCESS THE WORKSHEET IN A LOOP

  7. #7
    Board Regular
    Join Date
    Dec 2017
    Location
    UK
    Posts
    817
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)

    Default Re: I've entered too many arguments for function

    I for got to add the D13/1000 bit to it , but you should be able to work out that!!
    Speed up your code use variant arrays and NEVER ACCESS THE WORKSHEET IN A LOOP

Some videos you may like

User Tag List

Tags for this Thread

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
  •