# Thread: IF with multiple arguments Thanks: 0 Likes: 0

1. ## IF with multiple arguments

Guys can someone compare the below two and tell me where is the syntax error in 2nd formula? Formula 1 works fine (I copied it from a thread and changed inputs). In formula 2 I want to expand formula 1.

Formula 1 =IF(E5<=1625,(E5*0),IF(E5<=7000/3,(0+((E5-1625-E5*7.8%+\$B\$10/12+\$B\$11/12)*0.2)),(425/3+(E5-7000/3-E5*7.8%+\$B\$10/12+\$B\$11/12)*0.25)))

Formula 2 =IF(E9<=1625,(E9*0),IF(E9<=7000/3,(0+((E9-1625-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.2)),(425/3+(E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25))),(425.25+(E9-36300-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.30)))),(4090/3+(E9-5000-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.35)))))

The inputs are for tax calculation using different bands. First one calculates 2 bands, but I want to incorporate 4 bands.  Reply With Quote

2. ## Re: IF with multiple arguments

what are the conditions for

(425.25+(E9-36300-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.30))))

and

(4090/3+(E9-5000-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.35))))) ?  Reply With Quote

3. ## Re: IF with multiple arguments

Welcome to the Board!

However many bands you have, you will have one less IF statement.
Let's say that your bands are:
<1000
<2000
<3000
>=3000

Then the structure of your nested IF statement would be:
Code:
`=IF(E5<1000,calculation1,IF(E5<2000,calculation2,IF(E5<3000,calculation3,calculation4)))`  Reply With Quote

4. ## Re: IF with multiple arguments

So there is definitely an IF missing Let me see...  Reply With Quote

5. ## Re: IF with multiple arguments

So here I added Joey's and Alan's ideas, but still Excel output = too many arguments.

=IF(E9<=1625,(E9*0),IF(E9<=7000/3,(0+((E9-1625-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.2)),(425/3+(E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25)),IF(E9<=3025,(425/3+((E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25)),(3775/12+(E9-3025-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.30)),IF(E9<=5000,(5475/12+((E9-3025-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.30)),(10885/12+(E9-5000-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.35)))

Here are the bands I am using*

 Band % Accumulated tax 0-1625 - nil 1626-7000/3 20 425/3 7001/3-3025 25 3775/12 3026-5000 30 10885/12 over 5000 35

* The data is for Cyprus income tax and I divided everything by 12 to do monthly analysis  Reply With Quote

6. ## Re: IF with multiple arguments

Joey?!?!? My Mom doesn't even get to call me Joey!

It is important to understand how to nest IF statements. The structure of the IF function if:
=IF(condition, what to do if true, what to do if false)

So each IF statement can only have 3 arguments. When nesting, the third argument (false portion) is always your next IF statement, until you get to the very last one. In your second IF statement in your formula, you have 4 arguments. You have a formula in the false portion, and then try to add your IF after that.

I have highlighted the offending section of your code in red. I didn't check to see if you do this in your other IF statement after that.
Code:
`=IF(E9<=1625,(E9*0),IF(E9<=7000/3,(0+((E9-1625-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.2)),(425/3+(E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25)),IF...`
I would recommend setting up your nested IF statement structure first (liked I showed in post #3), and then drop the calculations in to the appropriate sections. There should be no commas in those calculations (as that would indicate two arguments/calculations).  Reply With Quote

7. ## Re: IF with multiple arguments

OK Joe Give me 12 hours to digest this. Will scrutinize this tomorrow.
Thanks.  Reply With Quote

8. ## Re: IF with multiple arguments

OK. If you run into trouble, post a grid like you did up in post #5, but add a column where you show us the exact formula to use for each band (what you are trying to put in your IF formula). Since you have some IF statements that have two formulas, I do not want to assume which one is correct.

Here is also a link that explains Nested IF statements in a bit more detail: Excel Nested If's
For each additional level you have, you would have another IF statement that resembles the structure of the first (not the last).  Reply With Quote

9. ## Re: IF with multiple arguments

try this

Code:
`=IF(E9<=1625,0,IF(E9<=7000/3,(E9-1625-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.2,IF(E9<=3025,425/3+(E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25,IF(E9<=5000,5475/12+(E9-3025-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.3,10885/12+(E9-5000-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.35))))`  Reply With Quote

10. ## Re: IF with multiple arguments Originally Posted by AlanY try this

Code:
`=IF(E9<=1625,0,IF(E9<=7000/3,(E9-1625-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.2,IF(E9<=3025,425/3+(E9-7000/3-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.25,IF(E9<=5000,5475/12+(E9-3025-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.3,10885/12+(E9-5000-E9*7.8%+\$B\$10/12+\$B\$11/12)*0.35))))`
Thanks Alan!
Though the result is not correct (must tweak some numbers) the syntax is error free.
Thanks guys for the time and effort invested. This board looks cool and highly responsive. Keep up the great work.  Reply With Quote

## User Tag List

#### Posting Permissions

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