Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find text before a certain point within a cell 1

Status
Not open for further replies.

HairyHippy

Programmer
Aug 5, 2004
53
GB
Is there a formula (or function) that will return the text before a comma within a single cell in Excel?

For Example:
Cells contains "Bloggs, Joe" and I want a formula or function that will return Bloggs. The "LEFT" forumla will not work as the comma might be in a different position in the next cell down, eg "Smith, John".

Thanks in advance!
 
use the FIND() function to return the position of the comma - then utilise that in the 2nd argument of the LEFT() function to tell it how many characters to use - remember to subtract 1 from the result of the FIND formula though as you want all the text before the comma
 
Thanks xlbo!
Knew it was something like that but couldn't get my head round it - need sleep!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top