Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
peopleschampion
 
Posts: n/a
Default I'm too argumentative

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the formula works fine. If I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively the same, I get an
error message saying I have entered too many arguments for this function. Have I got the
brackets wrong or is there some other reason why the second version doesn't work?

Bryan


  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

The syntax for IF function is:
=IF(ConditionIsTrue, FirstValue, SecondValue)
i.e. there are 3 arguments for IF function.

Your second formula is:
=IF(ConditionIsTrue, FirstValue, SecondValue, ThirdValue)
where ThirdValue is returned by IF function with omitted 3rd argument (when
condition is false, FALSE is returned):
IF(AnotherConditionIsTrue, ThirdValue)

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"peopleschampion" wrote in
message ...
If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the formula

works fine. If I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively

the same, I get an
error message saying I have entered too many arguments for this function.

Have I got the
brackets wrong or is there some other reason why the second version

doesn't work?

Bryan




  #3   Report Post  
Springbok
 
Posts: n/a
Default

Hi,

The format for an If worksheet function is as follows:

=IF(Logical Test, Value if True, Value if False)

Your formula has attempted to create a third.

Logical Test: (F9-G9)<0
Value if True: 0
Value if False: F9-G9
Invalid Argument: if(F9<0,F9)

The first fomula however appears correct.

Regards,
Jon

"peopleschampion" wrote:

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the formula works fine. If I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively the same, I get an
error message saying I have entered too many arguments for this function. Have I got the
brackets wrong or is there some other reason why the second version doesn't work?

Bryan



  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi


"peopleschampion" wrote in
message ...
Thank you for both rapid responses. I think I may be being a bit dim but

on the basis that a
formula can contain 7 nested if statements and I have used only 2 in both

my formulas I still
can't follow why formula one is incorrect.


You must put nested IF's into formula as one of existing 3 arguments, not as
additional ones. I.e. like this:
=IF(condition1,Value1,IF(condition2,Value2,IF(cond ition2,Value3,Value4)))
Here the first argument is condition1, the second argument is condition2,
and third one is a formula
IF(condition2,Value2,IF(condition2,Value3,Value4)) , etc.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


  #5   Report Post  
peopleschampion
 
Posts: n/a
Default

Thank you for both rapid responses. I think I may be being a bit dim but on the basis that a
formula can contain 7 nested if statements and I have used only 2 in both my formulas I still
can't follow why formula one is incorrect.

Bryan

"Springbok" wrote in message
...
Hi,

The format for an If worksheet function is as follows:

=IF(Logical Test, Value if True, Value if False)

Your formula has attempted to create a third.

Logical Test: (F9-G9)<0
Value if True: 0
Value if False: F9-G9
Invalid Argument: if(F9<0,F9)

The first fomula however appears correct.

Regards,
Jon

"peopleschampion" wrote:

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the formula works fine. If
I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively the same, I get an
error message saying I have entered too many arguments for this function. Have I got the
brackets wrong or is there some other reason why the second version doesn't work?

Bryan







  #6   Report Post  
Harald Staff
 
Posts: n/a
Default

Pattern:
=IF(Logical Test, Value if True, Value if False)

Your formula:
=IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)),

Logical test:
=IF((F9-G9)<0,
Value if True:
0,
Value if False:
(F9-G9),
nonsense argument:
if(F9<0,F9)

HTH. Best wishes Harald

"peopleschampion" skrev i
melding ...
Thank you for both rapid responses. I think I may be being a bit dim but

on the basis that a
formula can contain 7 nested if statements and I have used only 2 in both

my formulas I still
can't follow why formula one is incorrect.

Bryan

"Springbok" wrote in message
...
Hi,

The format for an If worksheet function is as follows:

=IF(Logical Test, Value if True, Value if False)

Your formula has attempted to create a third.

Logical Test: (F9-G9)<0
Value if True: 0
Value if False: F9-G9
Invalid Argument: if(F9<0,F9)

The first fomula however appears correct.

Regards,
Jon

"peopleschampion" wrote:

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the

formula works fine. If
I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks

effectively the same, I get an
error message saying I have entered too many arguments for this

function. Have I got the
brackets wrong or is there some other reason why the second version

doesn't work?

Bryan







  #7   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Thu, 3 Mar 2005 08:19:27 -0000, "peopleschampion"
wrote:

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the formula works fine. If I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively the same, I get an
error message saying I have entered too many arguments for this function. Have I got the
brackets wrong or is there some other reason why the second version doesn't work?

Bryan


In the second formula, your final "IF" statement is the 4th argument of the
first IF statement.

Since IF statement can only have three arguments, you get the error message:

=IF(
F9-G9)<0, Argument 1
0, Argument 2
(F9-G9), Argument 3
IF(F9<0, Argument 4 (Illegal)
F9))

--ron
  #8   Report Post  
JMay
 
Posts: n/a
Default

It should be mentioned (In Passing) that when using the If() statement..
Argument 3 is Optional.
Jim

"Ron Rosenfeld" wrote in message
...
On Thu, 3 Mar 2005 08:19:27 -0000, "peopleschampion"
wrote:

If I enter =IF(F9<0,F9,IF((F9-G9)<0,0,(F9-G9))) into Excel 97 the

formula works fine. If I
enter =IF((F9-G9)<0,0,(F9-G9),if(F9<0,F9)), which to me looks effectively

the same, I get an
error message saying I have entered too many arguments for this function.

Have I got the
brackets wrong or is there some other reason why the second version

doesn't work?

Bryan


In the second formula, your final "IF" statement is the 4th argument of

the
first IF statement.

Since IF statement can only have three arguments, you get the error

message:

=IF(
F9-G9)<0, Argument 1
0, Argument 2
(F9-G9), Argument 3
IF(F9<0, Argument 4 (Illegal)
F9))

--ron



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"