ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Question for about using IF formula LEFT function at the same time (https://www.excelbanter.com/excel-worksheet-functions/123097-question-about-using-if-formula-left-function-same-time.html)

jlandes84

Question for about using IF formula LEFT function at the same time
 
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.

Roger Govier

Question for about using IF formula LEFT function at the same time
 
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.

--
Regards

Roger Govier


"jlandes84" wrote in message
...
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.




jlandes84

Question for about using IF formula LEFT function at the same
 
Thank you, Roger.

That did it.

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


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com