ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF Function - Begins With (https://www.excelbanter.com/excel-discussion-misc-queries/56956-if-function-begins.html)

Cecil

IF Function - Begins With
 

How do I apply the "begins with" filter to an IF statement? I would
like to test a match on the first 3 characters of a string in a given
cell?


--
Cecil
------------------------------------------------------------------------
Cecil's Profile: http://www.excelforum.com/member.php...o&userid=29035
View this thread: http://www.excelforum.com/showthread...hreadid=487648


SteveG

IF Function - Begins With
 

Cecil,

=IF(LEFT(A1,3)="ABCD",A1,"")

This will look at the 3 leftmost characters and return a value if it is
true.

Regards,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=487648


SteveG

IF Function - Begins With
 

Cecil,


=IF(LEFT(A1,3)="ABC",A1,"")

Only indicate 3 characters in quotes. My last example had 4. Sorry!

Cheers,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=487648


Cecil

IF Function - Begins With
 

Yes, that's it! Thanks, Steve.


--
Cecil
------------------------------------------------------------------------
Cecil's Profile: http://www.excelforum.com/member.php...o&userid=29035
View this thread: http://www.excelforum.com/showthread...hreadid=487648



All times are GMT +1. The time now is 08:57 PM.

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