Nested IF

M

Matt

I've got a doozy for you. I REALLY hope you can help.

If(or(b4="v",b4="s",b4="h"),.3125,"")
If(or(b4="hh",b4="hs",b4="hv",.3125-(g4-c4-(f4-e4)),"")

I need to put those 2 IF statements in the same cell.
What I need to happen is if cell b4="v" the formula stops
running after it enters .3125 as the cell value. On the
other hand, if the cell doesn't = v,s,h than the formula
should then allow a check for hh,hs,hv and execute the
resulting arithmetic. And of course, if it doesn't
include any of those letters than it should return a null
result.

So far, I've only been able to successfully join them
with a comma, resulting in the formula running through
every step of both If/Or formulas.

Thanks for the help,

Matt
 
K

Kieran

Matt,

try

If(or(b4="v",b4="s",b4="h"),0.3125,If(or(b4="hh", b4="hs", b4="hv",
0.3125-(g4-c4-f4+e4),""))
 
D

Dave R.

You don't need the "" after the first IF, since if b4<>v,s, or h, then you
want to evaluate the 2nd if statement. If THAT one's not true, then use "".
In other words, it will look at the first, if not that, then look at the
2nd, on to the 3rd, 4th, 5th, 6th, 7th, 8th statements. At the end of the
last statement, you can have the "" since all the other viable options are
exhausted.

So (this is untested, may be missing a parenthesis...)

If(or(b4="v",b4="s",b4="h"),.3125,If(or(b4="hh",b4="hs",b4="hv",.3125-(g4-c4
-(f4-e4)),"")
 
D

Don Guillett

not tested but can't you just put em together?
=If(or(b4="v",b4="s",b4="h"),.3125,If(or(b4="hh",b4="hs",b4="hv",.3125-(g4-c
4-(f4-e4)),""))
 
M

Matt

Thank you very much. I'm embarrassed to say that your
explanation is very simple yet I have missed it for
days. I can see how having the second IF statement as
the False part of the first IF statement will work.
Thank you very much!
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top