multiple if statements

A

Alex McKenzie

Hi all
Thanks for help in the past

I have in cell A1 either an "L" or an "S"

If cell A1= "L" then I require the following formula
(which refers to other cells)
in cell A2

=IF(D9<E10,1,IF(D9<E11,2,IF(D9>E11,3)))

but if cell A1="S" then I need a slightly different
formula

=IF(D9>E10,1,IF D9>E11,2,IF D9<E11,3)))

in cell A2

Many thanks in advance

Alex
 
B

Bryan Hessey

Allowing for D9=E10=E11, try

=IF(A1="S",IF(D9<E10,1,IF(D9<E11,2,IF(D9>E11,3,"eq"))),IF(A1="L",IF(D9>E10,1,IF(D9>E11,2,IF(D9<E11,3,"eq")))))
 
G

Guest

=IF(AND(A1="L",D9<E10),1,IF(AND(A1="L",D9<E11),2,IF(AND(A1="L",D9>E11),3,IF(AND(A1="S",D9>E10),1,IF(AND(A1="S",D9>E11),2,IF(AND(A1="S",D9<E11),3,))))))
some of your conditions arent exclusive.....i think these will only work if
there are numbers in d9 and e10 or in d9 and e11.However i hope this helps.I
cant help thinking there may be a more elegant way.
 
B

Bob Phillips

=IF(OR(AND(D9<E10,A1="L"),AND(D9>E10,A1="S")),1,IF(OR(AND(D9<E11,A1="L"),AND
(D9>E11,A1="S")),2,IF(OR(AND(D9>E11,A1="L"),AND(D9<E11,A1="S")),3)))


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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