ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Are there too many arguments (https://www.excelbanter.com/excel-worksheet-functions/9105-there-too-many-arguments.html)

Pat

Are there too many arguments
 
There is nothing wrong with the following formula:
=IF(B75=CHAR(252),J75,"")

What I want to do is add another argument to the formula as follows:
=IF(B74=CHAR(252),J74,"",IF(J740,K22="QS"),0,J74) ))

Many thanks if you can be of help.
Pat



JulieD

Hi Pat

an IF statement has only three parameters Test, True, False
you've tried for six
Test, True, False,Test,True,False

you can nest other IF statements within an IF statement in the following way
=IF(Test1,IF(Test2,True,False),IF(Test3,True,False ))
here there's a IF statement (test2) in the true bit of Test1 and other one
in the false bit of Test1

however, i'm not sure when you want the second IF evaluated - do you want it
evaluated IF B74=Char(252)
e.g.
=IF(B75=CHAR(252),IF(J740,K22="QS",J74),"")

(you also had 4 parameters in this IF statement so i've taken 1 out)

Cheers
JulieD


"Pat" wrote in message
...
There is nothing wrong with the following formula:
=IF(B75=CHAR(252),J75,"")

What I want to do is add another argument to the formula as follows:
=IF(B74=CHAR(252),J74,"",IF(J740,K22="QS"),0,J74) ))

Many thanks if you can be of help.
Pat




AlecHull

Also the K22="QS" part is not clear - is this a tested condition or a
desired result? I think it's the second of a two-part test -- if so you can
use the AND function (or the OR function) to test them together. You might
be looking for this:

=IF(B74=CHAR(252),J74,IF(AND(J740,K22="QS"),0,J74 ))

but I'm not sure when you want to return "". Try different nesting schemes
as JulieD mentioned.


"JulieD" wrote:

Hi Pat

an IF statement has only three parameters Test, True, False
you've tried for six
Test, True, False,Test,True,False

you can nest other IF statements within an IF statement in the following way
=IF(Test1,IF(Test2,True,False),IF(Test3,True,False ))
here there's a IF statement (test2) in the true bit of Test1 and other one
in the false bit of Test1

however, i'm not sure when you want the second IF evaluated - do you want it
evaluated IF B74=Char(252)
e.g.
=IF(B75=CHAR(252),IF(J740,K22="QS",J74),"")

(you also had 4 parameters in this IF statement so i've taken 1 out)

Cheers
JulieD


"Pat" wrote in message
...
There is nothing wrong with the following formula:
=IF(B75=CHAR(252),J75,"")

What I want to do is add another argument to the formula as follows:
=IF(B74=CHAR(252),J74,"",IF(J740,K22="QS"),0,J74) ))

Many thanks if you can be of help.
Pat





Pat

Thank you both for helping me out, the correct solution I was after is as
follows:

=IF(B78=CHAR(252),J78,IF(OR(J780,K22="QS"),0,J78) )

Pat

"AlecHull" <alechull-aol-com wrote in message
...
Also the K22="QS" part is not clear - is this a tested condition or a
desired result? I think it's the second of a two-part test -- if so you
can
use the AND function (or the OR function) to test them together. You
might
be looking for this:

=IF(B74=CHAR(252),J74,IF(AND(J740,K22="QS"),0,J74 ))

but I'm not sure when you want to return "". Try different nesting
schemes
as JulieD mentioned.


"JulieD" wrote:

Hi Pat

an IF statement has only three parameters Test, True, False
you've tried for six
Test, True, False,Test,True,False

you can nest other IF statements within an IF statement in the following
way
=IF(Test1,IF(Test2,True,False),IF(Test3,True,False ))
here there's a IF statement (test2) in the true bit of Test1 and other
one
in the false bit of Test1

however, i'm not sure when you want the second IF evaluated - do you want
it
evaluated IF B74=Char(252)
e.g.
=IF(B75=CHAR(252),IF(J740,K22="QS",J74),"")

(you also had 4 parameters in this IF statement so i've taken 1 out)

Cheers
JulieD


"Pat" wrote in message
...
There is nothing wrong with the following formula:
=IF(B75=CHAR(252),J75,"")

What I want to do is add another argument to the formula as follows:
=IF(B74=CHAR(252),J74,"",IF(J740,K22="QS"),0,J74) ))

Many thanks if you can be of help.
Pat







JulieD

Hi Pat

glad you figured out your formula - thanks for the feedback

Cheers
JulieD

"Pat" wrote in message
...
Thank you both for helping me out, the correct solution I was after is as
follows:

=IF(B78=CHAR(252),J78,IF(OR(J780,K22="QS"),0,J78) )

Pat

"AlecHull" <alechull-aol-com wrote in message
...
Also the K22="QS" part is not clear - is this a tested condition or a
desired result? I think it's the second of a two-part test -- if so you
can
use the AND function (or the OR function) to test them together. You
might
be looking for this:

=IF(B74=CHAR(252),J74,IF(AND(J740,K22="QS"),0,J74 ))

but I'm not sure when you want to return "". Try different nesting
schemes
as JulieD mentioned.


"JulieD" wrote:

Hi Pat

an IF statement has only three parameters Test, True, False
you've tried for six
Test, True, False,Test,True,False

you can nest other IF statements within an IF statement in the following
way
=IF(Test1,IF(Test2,True,False),IF(Test3,True,False ))
here there's a IF statement (test2) in the true bit of Test1 and other
one
in the false bit of Test1

however, i'm not sure when you want the second IF evaluated - do you
want it
evaluated IF B74=Char(252)
e.g.
=IF(B75=CHAR(252),IF(J740,K22="QS",J74),"")

(you also had 4 parameters in this IF statement so i've taken 1 out)

Cheers
JulieD


"Pat" wrote in message
...
There is nothing wrong with the following formula:
=IF(B75=CHAR(252),J75,"")

What I want to do is add another argument to the formula as follows:
=IF(B74=CHAR(252),J74,"",IF(J740,K22="QS"),0,J74) ))

Many thanks if you can be of help.
Pat










All times are GMT +1. The time now is 08:26 PM.

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