IF with multiple arguments

krokodilizm

New Member
Joined
Feb 3, 2016
Messages
20
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.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
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))))) ?
 
Upvote 0
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)))
 
Upvote 0
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/320425/3
7001/3-3025253775/12
3026-50003010885/12
over 500035

<tbody>
</tbody>

* The data is for Cyprus income tax and I divided everything by 12 to do monthly analysis
 
Upvote 0
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:
[COLOR=#333333]=IF(E9<=1625,(E9*0),IF(E9<=7000/3,(0+((E9-1625-E9*7.8%+$B$10/12+$B$11/12)*0.2)),[/COLOR][COLOR=#ff0000](425/3+(E9-7000/3-E9*7.8%+$B$10/12+$B$11/12)*0.25)),IF[/COLOR][COLOR=#333333]...[/COLOR]
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).
 
Upvote 0
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).
 
Upvote 0
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))))
 
Last edited:
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top