#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Syntax HELP

I know this is wrong...
=if(G400,G40*$G$36,""),or(if(I400,I40*$I$36,"")o r(if(K400,K40*K36,"")


but what is the correct way to write an IF,OR statement?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Syntax HELP

It doesn't look to me like you want an Or condition. You want nested Ifs, as
in:
=if(G400,G40*$G$36,if(I400,I40*$I$36,if(K400,K4 0*K36,"")))

Regards,
Fred.


"Eric H" wrote in message
...
I know this is wrong...
=if(G400,G40*$G$36,""),or(if(I400,I40*$I$36,"")o r(if(K400,K40*K36,"")


but what is the correct way to write an IF,OR statement?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Syntax HELP

Depends on what you want. This checks g40 and if 0,g40*g36. If not then
checks i40 and then checks k40.
Is this what you want?
=IF(G400,G40*G36,IF(I400,I40*I36,IF(K400,K40*K3 6,"")))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric H" wrote in message
...
I know this is wrong...
=if(G400,G40*$G$36,""),or(if(I400,I40*$I$36,"")o r(if(K400,K40*K36,"")


but what is the correct way to write an IF,OR statement?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Syntax HELP

Eric H wrote:
I know this is wrong...
=if(G400,G40*$G$36,""),or(if(I400,I40*$I$36,"")o r(if(K400,K40*K36,"")


but what is the correct way to write an IF,OR statement?


Hi Eric,

Well, the way to do OR is a little backwards in my opinion, but it goes
like this:

=OR(condition 1, condition 2, etc...)

This will return TRUE or FALSE.

But I don't think that's what you are trying to do. So forget about OR
for now.

IF can be used to make choices, like "IF..ELSEIF" by nesting. The
general form of IF is

=IF(condition, value if TRUE, value if FALSE)

This can be expanded to make choices as follows:

=IF(condition 1, value if true, IF(condition 2, value if true,
IF(condition 3, value if true, default value)))

You can nest IF like this for a few levels. I don't recall how many
because I seldom do this (it gets quite tricky to edit and maintain
after 2 or three levels).

I leave it to you to think about your formula, but here are some hints.
You are making three tests (G400, etc.) How are these prioritized? The
highest priority decision goes in the first condition of your nested IF.
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Syntax HELP

Thanks to all. It was helpful and got me on my way.

"smartin" wrote:

Eric H wrote:
I know this is wrong...
=if(G400,G40*$G$36,""),or(if(I400,I40*$I$36,"")o r(if(K400,K40*K36,"")


but what is the correct way to write an IF,OR statement?


Hi Eric,

Well, the way to do OR is a little backwards in my opinion, but it goes
like this:

=OR(condition 1, condition 2, etc...)

This will return TRUE or FALSE.

But I don't think that's what you are trying to do. So forget about OR
for now.

IF can be used to make choices, like "IF..ELSEIF" by nesting. The
general form of IF is

=IF(condition, value if TRUE, value if FALSE)

This can be expanded to make choices as follows:

=IF(condition 1, value if true, IF(condition 2, value if true,
IF(condition 3, value if true, default value)))

You can nest IF like this for a few levels. I don't recall how many
because I seldom do this (it gets quite tricky to edit and maintain
after 2 or three levels).

I leave it to you to think about your formula, but here are some hints.
You are making three tests (G400, etc.) How are these prioritized? The
highest priority decision goes in the first condition of your nested IF.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
The NOW() syntax Tom Excel Discussion (Misc queries) 3 January 4th 08 04:10 PM
IRR Syntax Bruce Excel Worksheet Functions 1 July 13th 07 09:02 PM
SQL syntax Spike Excel Worksheet Functions 2 March 8th 07 08:27 AM
VBA syntax Sunantoro Excel Discussion (Misc queries) 1 September 21st 05 03:19 AM
Syntax Help Dmorri254 Excel Worksheet Functions 2 March 2nd 05 02:51 PM


All times are GMT +1. The time now is 08:56 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"