Echwaz
Echwaz

Reputation: 13

Excel Spreadsheet IF function issue

I'm having a problem with an Excel Spreadsheet IF function. I'm hoping someone can help fix it. The problem has either been ")" "(" or "," but now it's "to many arguments"

=IF(C8<=0,0,C8,IF(C8=E7,C8*F6,0,IF(C8=E8,(F7*(C8-(C8*F6))),0,IF(C8=E9,(F8*(C8-(F7*(C8-(C8*F6))))),0,IF(C8>E9,(F9*(C8-(F8*(C8-(F7*(C8-(C8*F6))))))),0,)

The spreadsheet function is for Federal taxes if that helps any.

C8= original amount
E7= maximum tax bracket amount
F6= percent amount
E8= Next max tax bracket amount
F7= percent amount
E9= Next maximum tax bracket
F8= Percent amount


Federal Tax Rate: single        
Lower   Rate

$0.00       10% 
$9,075.00   15% 
$36,900.00  25% 
$89,350.00  28%

Hopefully the edits might help with any answers, I appreciate any effort folks!

The correct result for the If function

=IF($C$8<=0,0,IF($C$8=$E$7,$C$8*$F$6,IF($C$8=$E$8,($F$7*($C$8-($C$8*$F$6))),IF($C$8=$E$9,($F$8*($C$8-($F$7*($C$8-($C$8*$F$6))))),IF($C$8>$E$9,($F$9*($C$8-($F$8*($C$8-($F$7*($C$8-($C$8*$F$6))))))),0)))))

Upvotes: 0

Views: 206

Answers (1)

Dijkgraaf
Dijkgraaf

Reputation: 11527

In Excel the IF function has the format of

=IF(logical_test, [value_if_true], [value_if_false])

Looking at your formula

=IF(C8<=0,  <--Condition
    0,  <--True
    C8, <--False
    IF( <-- Too many arguments
        C8=E7, <--Condition
        C8*F6, <--True
        0,     <--False
        IF(    <-- Too many arguments
            C8=E8,          <--Condition
            (F7*(C8-(C8*F6)))   <--True
            ,0          <--False
            ,IF(            <-- Too many arguments
                C8=E9,              <--Condition
                (F8*(C8-(F7*(C8-(C8*F6))))),    <--True
                0,              <--False
                IF(             <-- Too many arguments
                    C8>E9,                  <--Condition
                    (F9*(C8-(F8*(C8-(F7*(C8-(C8*F6)))))))   <--True
                    ,0                                      <--False
                    ,                   <--Too many arguments (excess comma)
                )

As n8 stated in the comments. You can't have 3 commas in an "IF" statement. If you want to nest another "IF" statement within you have to put it into either the "TRUE" or "FALSE" area, not after both (like you've done)

Maybe you meant

=IF
 (
  C8<=0,  <-- logical test
  C8,     <-- value if true
  IF      <-- value if false

What you may want to do is give each cell used in the formula a label and then use that label in the formula, and build it up gradually. Start of with a single if,

=IF(OriginalAmount<=0,0,OriginalAmount)

That is if OriginalAmount is less than 0 it returns 0, otherwise show the OriginalAmount

Then add a new condition and outcomes, either in the true or false part.

=IF(OriginalAmount<=0,0,IF(condition,true,false))

Upvotes: 1

Related Questions