Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to calculate current stock or inventory in Excel
  • Error Bars in Excel
  • How to create a Histogram in Excel
  • How to calculate average last N values in a table in Excel
  • Excel Line Chart

References

  • How to get first column number in range in Excel
  • Offset in Excel
  • How to get relative column numbers in a range in Excel
  • Extract data with helper column in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions

Data Validations

  • Excel Data validation don’t exceed total
  • Excel Data validation must begin with
  • Excel Data validation whole percentage only
  • Excel Data validation unique values only
  • Excel Data validation exists in list

Get first name from name with comma — Manipulating NAMES in Excel

by

To extract the first name from a full name in “Last, First” format, you can use a formula that uses RIGHT, LEN and FIND functions.

Note: this formula will only work with names in Last, First format, separated with a comma and space.

Formula

=RIGHT(name,LEN(name)-FIND(", ",name)-1)

Explanation

From the table and formula (above), name represent full name in this format:

LAST, FIRST
Philip, White
Tom, Green
Chalk, Black

A comma and space separate the last name from the first name.

Worked Example:   Find function vs Search function in Excel

In the example, the active cell contains this formula:

=RIGHT(B4,LEN(B4)-FIND(", ",B4)-1)

How this formula works

At a high level, this formula uses RIGHT to extract characters from the right side of the name. To figure out the number of characters that need to be extracted to get the first name, the formula uses the FIND function to locate the position of “, ” in the name:

FIND(", ",B4) // position of comma

FIND returns the position of the comma and space as a number. This number is then subtracted from the total length of the name:

LEN(B4)-FIND(", ",B4) // length of first name + 1

The result is the length of the first name, plus one extra character, due to the comma. To get the true length, 1 is subtracted:

LEN(B4)-FIND(", ",B4)-1 // length of the first name

Because the name is in reverse order (LAST, FIRST), the RIGHT function can simply extract the length of the first name.

Worked Example:   Remove text by variable position in a cell in Excel

For the example, the name is “Chang, Amy”, the position of the comma is 6. So the inner formula simplifies to this:

Worked Example:   How to count line breaks in cell in Excel worksheet

10 – 6 – 1 = 3 // length of first name

Then:

RIGHT("Chang, Amy",3) // "Amy"

 

Post navigation

Previous Post:

Put names into proper case — Manipulating NAMES in Excel

Next Post:

Create One-dimensional and Two-dimensional Array

Leave a Reply Cancel reply

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

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • How to return blank in place of #DIV/0! error in Excel
  • OR function Examples in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • Invoice status with nested if in Excel
  • Not Equal To ‘<>‘ operator in Excel

Date Time

  • NETWORKDAYS.INTL function: Description, Usage, Syntax, Examples and Explanation
  • DAYS360 function: Description, Usage, Syntax, Examples and Explanation
  • Get first Monday before any date in Excel
  • Convert text timestamp into time in Excel
  • Convert decimal hours to Excel time

Grouping

  • Group numbers at uneven intervals in Excel
  • Running count group by n size in Excel
  • Group numbers with VLOOKUP in Excel
  • How to randomly assign data to groups in Excel
  • Categorize text with keywords in Excel

General

  • Sum by group in Excel
  • How to test a range for numbers in Excel
  • List worksheet index numbers in Excel
  • How to generate random number between two numbers in Excel
  • Lock Cells in a Worksheet Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning