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

1. ## 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. ## Re: I've entered too many arguments for function

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

3. ## 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.

4. ## 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.

5. ## 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. ## 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??

7. ## 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!!