To extract the first word of a string, a formula must locate the position of the first space charac-
ter and then use this information as an argument for the LEFT function. The following formula
does just that:
=LEFT(A1,FIND(“ “,A1)-1)
This formula returns all of the text prior to the first space in cell A1. However, the formula has a
slight problem: It returns an error if cell A1 consists of a single word. A simple modification solves
the problem by using an IFERROR function to check for the error:
=IFERROR(LEFT(A1,FIND(“ “,A1)-1),A1)
For compatibility with versions prior to Excel 2007, use this formula:
=IF(ISERR(FIND(“ “,A1)),A1,LEFT(A1,FIND(“ “,A1)-1))
ter and then use this information as an argument for the LEFT function. The following formula
does just that:
=LEFT(A1,FIND(“ “,A1)-1)
This formula returns all of the text prior to the first space in cell A1. However, the formula has a
slight problem: It returns an error if cell A1 consists of a single word. A simple modification solves
the problem by using an IFERROR function to check for the error:
=IFERROR(LEFT(A1,FIND(“ “,A1)-1),A1)
For compatibility with versions prior to Excel 2007, use this formula:
=IF(ISERR(FIND(“ “,A1)),A1,LEFT(A1,FIND(“ “,A1)-1))
No comments:
Post a Comment