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