EXCEL: How to extract text before a comma, space or period [SOLVED]

Excel tip: 

If you try to extract text before a space ” “, comma “,” or period “.” in Excel you may try something along these lines:
=LEFT(A2,(FIND(" ",A2,1)-1))

However, if you have non-matching records, i.e. something without a space in the previous example then you will get the following result:

This is not the value you are looking for

Since that is probably not what you wanted, try the following:
=IFERROR(LEFT(A2,(FIND(" ",A2,1)-1)),A2)

Which will result in either (A) the shortened result (where applicable) or (B) the original data (which did not have a space in the first place).



Here is an example of the formula in action:

Only show data that comes before the first space


Leave a Reply

Your email address will not be published. Required fields are marked *