Search code examples
excelworksheet-function

Excel function to get first word from sentence in other cell


Excel: What function can I use to take the all the characters from the beginning to the first '<". I am trying to strip out the first word from A1 and put it into B1

Eg:

A1
Toronto<b> is nice

I want "Toronto" in the next cell.

Ian


Solution

  • How about something like

    =LEFT(A1,SEARCH(" ",A1)-1)
    

    or

    =LEFT(A1,SEARCH("<b>",A1)-1)
    

    Have a look at MS Excel: Search Function and Excel 2007 LEFT Function