Help with IF statement

M

momma2all

I am trying create the following statement - however I want the value of the
cell to appear not the cell position:

IF(S5>U6,"S5", IF(S5<U6, "U6"))

the values in in the cells are dates; hoever, when I enter the statement the
cell populates as S5 or U6 not the date that is formatted in the appropriate
cell.
 
T

T. Valko

IF(S5>U6,"S5", IF(S5<U6, "U6"))

To answer your question:

Remove the quotes:

IF(S5>U6,S5,IF(S5<U6,U6))

The only time you need quotes is when you have hardcoded text:

=IF(A1="Yes","A1 equals Yes","A1 does not equal Yes")

=IF(A1<10,"A1 is less than 10","A1 is not less than 10")

Now, there'a "black hole" in your logic! What if S5=U6? You haven't
accounted for that possibility. If S5=U6 then your formula would return
FALSE.

Maybe this is what you want:

=MAX(S5,U6)
 
M

momma2all

It never donned on me to use a MAX statement - I guess I have been working
ont his thing too long today! Thanks for all your help!!
 

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