Home » excel » Excel filter out name

Excel filter out name

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have an excel row that i need to filter down. I want to filter out just the first name and last name, see example below. I cant seem to find a vlookup for this scenario.

Before:

enter image description here

After:

enter image description here

How to&Answers:

To extract the first name, use:

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

And for the second name:

=MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1))

The breakdown:

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

  • We use FIND to locate the first space (” “) in the data (A1).
  • Using LEFT, we extract everything from the leftmost character up to the location of the first space and -1 to account for the space character.

=MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1))

  • We use FIND to locate the second space (” “) in the data (A1), adding the formula for locating the first space as a parameter to the next FIND (FIND(” “,A1)+1). Note that it is +1 now because we want to look past the location of space character.
  • We now have the location of the second space character. We subtract the second space character location from the first space character location which gives us the total length of the second word. (FIND(” “,A1,FIND(” “,A1)+1)-FIND(” “,A1))
  • Similar to LEFT, we use MID to extract data from the middle of the data string. We are simply saying MIDDLE(data, where to start, length of desired data).