ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF Statement question (https://www.excelbanter.com/excel-worksheet-functions/20410-if-statement-question.html)

gryfon

IF Statement question
 
I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF(C3<322,SUM(C3*0.37)-78.7669))
I get error message "Too many arguements for this function"

Can someone tell me where I'm going wrong
TIA



Biff

Hi!

Well, for starters, you don't need any of the SUM
functions in either formula. They're basically doing
nothing. They're just summing a single number returned by
a particular IF function.

You can write those formulas as:

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04))

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04,IF(C3<322,C3*0.37-
78.7669)))

In both cases however, if C3 = 298 and 322 in each
respective formula, You'll get a return of FALSE since you
haven't defined that variable at the end of either formula.

Biff

-----Original Message-----
I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF

(C3<322,SUM(C3*0.37)-78.7669))
I get error message "Too many arguements for this

function"

Can someone tell me where I'm going wrong
TIA


.


JE McGimpsey

Couple of things:

1) You don't need the SUM()s

2) Try

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04,IF(C3<322,C3*0.37-78.7889,"Greater
than or equal to 322")))



In article ,
"gryfon" wrote:

I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF(C3<322,SUM(C3*0.37)-78.766
9))
I get error message "Too many arguements for this function"

Can someone tell me where I'm going wrong
TIA


Myrna Larson

You aren't nesting the IF statements properly. The right parenthesis after the
19.04 doesn't belong there, but rather at the end of the formula, like this:

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04,IF(C3<322,SUM(C3*0.37)-78.7669))))

BUT you don't need any SUM functions. You use SUM when you want to add several
numbers. You aren't doing that. This should be written as

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04,IF(C3<322,C3*0.37-78.7669)))


On Mon, 04 Apr 2005 03:15:35 GMT, "gryfon" wrote:

I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF(C3<322,SUM(C3*0.37)-78.7669))
I get error message "Too many arguements for this function"

Can someone tell me where I'm going wrong
TIA



Aladin Akyurek

=IF(C3<112,0,IF(C3<298,(C3*0.17)-19.04,IF(C3<322,(C3*0.37)-78.7669,"Not
Defined")))

When C3 = 322, you'll get "Not Defined".

gryfon wrote:
I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF(C3<322,SUM(C3*0.37)-78.7669))
I get error message "Too many arguements for this function"

Can someone tell me where I'm going wrong
TIA



gryfon

Thanks, Works like a charm.
"Biff" wrote in message
...
Hi!

Well, for starters, you don't need any of the SUM
functions in either formula. They're basically doing
nothing. They're just summing a single number returned by
a particular IF function.

You can write those formulas as:

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04))

=IF(C3<112,0,IF(C3<298,C3*0.17-19.04,IF(C3<322,C3*0.37-
78.7669)))

In both cases however, if C3 = 298 and 322 in each
respective formula, You'll get a return of FALSE since you
haven't defined that variable at the end of either formula.

Biff

-----Original Message-----
I can this statement to work

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04)))
but when I add to it like this

=SUM(IF(C3<112,(0),IF(C3<298,SUM(C3*0.17)-19.04),IF

(C3<322,SUM(C3*0.37)-78.7669))
I get error message "Too many arguements for this

function"

Can someone tell me where I'm going wrong
TIA


.




[email protected]


wrote:
Thanks, Works like a charm.
"Biff" wrote in message
...


Thank you





All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com