Question for about using IF formula LEFT function at the same time

J

jlandes84

Can the LEFT text function be used in an IF formula?

For example:

Instead of =IF(F7<G7,"SEA","SF") how would this work?
=IF(F7<G7,"=LEFT(C6,3)","=LEFT(C5,3)")

Instead of getting Sea or San as my result, I get EFT(C6,3)

What am I missing?

Thanks in advance.
 
R

Roger Govier

Hi

Just remove the double quotes and the extra = signs

=IF(F7<G7,LEFT(C6,3),LEFT(C5,3))

If F7 were not less than G7 however, you result would be the equivalent
of "SF " i.e. there would be a trailing space after the SF, if the
contents of C5 were only SF. Otherwise, it would also give you the third
character in that cell.

This might give you a problem later if you were trying to compare
whether that cell was equal to "SF", as it would not be so.
 
J

jlandes84

Thank you, Roger.

That did it.

I do hate it when I make things more complicated than they need to be :)
 
Top