IF function within an IF function?

P

picktr

How can I nest an IF function within an IF function?

What I have now:

=IF(G5<G6,"A","B")

What I would like:

IF G5 <= G6
THEN IF J5 < J6, "A", "B"
ELSE "B"

If the the first 2 comparisons are equal, I want it to
evaluate different cell
 
P

Paul Falla

=IF (G5 <= G6,IF(J5 < J6, "A", "B" ),"B") should do it for
you.

Hope this helps

Paul Falla
 
M

macropod

Hi,

Try:
=IF(G5<=G6,IF(J5<J6,"A","B"),"B")
or, better still:
=IF(AND(G5<=G6,J5<J6),"A","B")

Cheers
 
P

picktr

H,I are hidden

E F G J

5 Jeff B 10 10
6 Steve B 10 9


Both formulas are returning B

The result should be Jeff B
Steve
 
P

Peo Sjoblom

That's not what you asked for, the conditions you stated with

G5<G6 i.e. 10 is not less than 10 so that is FALSE
J5<J6 i.e. 10 is not less than 9 so that is also FALSE
 
P

picktr

Peo,

Than how do I correct it?
( F ) ( G )
( J )
row5 Jeff ( B ) (10) (10)
row6 Steve ( A ) (10) (10)

I want the first evaluation to be from the first column of numbers
in column G

If both are = than it should look at the second column of numbers
in column J, then perform the function

If it were just the first column of numbers, that is easy
 
Top