if statements in excel with multiple variables

G

Guest

I am trying to write a formula that considers multiple variables. I have
tried the following:
=IF(OR(B21>0.01,B21<=0.99),0.3,0.35)
and
=IF(AND(B21>0.01,B21<=0.99),0.3,0.35)
These work in themselves but I am trying to get it to also consider if the
relevant cell b21=0.
I need ithe formula to accept that IF b21>.01 and b21<=.99, it will display
..30, if it is above .01-.99 it displays .35 UNLESS the value of b21=0 then I
need it to display 0.

Help in this would be greatly appreciated.
 
G

Guest

=IF(B21=0,0,IF(AND(B21>0,B21<1),0.3,0.35))

You can obviously change the 2nd IF conditions to >.01 & <=.99 as you have
it. But in that case, if B21 equals .01 or if B21 equals .991, then you'll
get 0.35. Using 0 & 1 eliminates that.
 
P

Peo Sjoblom

Sounds as though you could use

=VLOOKUP(B21,{0,0;0.01,0.3;1,0.35},2)

however what to you want the result to be if B21 = 0.01?
if you want the result to be zero

=VLOOKUP(B21,{0,0;0.02,0.3;1,0.35},2)


--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 

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