Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The NOW() syntax | Excel Discussion (Misc queries) | |||
IRR Syntax | Excel Worksheet Functions | |||
SQL syntax | Excel Worksheet Functions | |||
VBA syntax | Excel Discussion (Misc queries) | |||
Syntax Help | Excel Worksheet Functions |