Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Extract data with helper column in Excel
  • How to use Excel OFFSET function
  • How to use Excel FORMULATEXT function
  • How to use Excel ROW Function
  • Create hyperlink with VLOOKUP in Excel

Data Analysis Examples

  • How to count table columns in Excel
  • Understanding Anova in Excel
  • How to create Checklist in Excel
  • Excel Line Chart
  • Conditional Formatting Color Scales Examples in Excel

Data Validation Examples

  • Excel Data validation allow weekday only
  • Excel Data validation don’t exceed total
  • Prevent invalid data entering in specific cells
  • Excel Data validation allow uppercase only
  • Excel Data validation unique values only

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:   Get workbook name and path without sheet 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:   How to get last line in 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 get sheet name only in Excel

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

Then:

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

 

Post navigation

Previous Post:

Split dimensions into two parts in Excel Worksheet

Next Post:

Get first name from full name — Manipulating NAMES in Excel

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
  • CONCAT function: Description, Usage, Syntax, Examples and Explanation
  • Split numbers from units of measure in Excel
  • Convert text to numbers using VALUE function in Excel
  • How to Remove Leading Spaces in Excel
  • Remove file extension from filename in Excel
  • Get first Monday before any date in Excel
  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • DAYS function: Description, Usage, Syntax, Examples and Explanation
  • Convert Unix time stamp to Excel date
  • Get days before a date in Excel
  • INTRATE function: Description, Usage, Syntax, Examples and Explanation
  • TBILLYIELD function: Description, Usage, Syntax, Examples and Explanation
  • Calculate payment for a loan in Excel
  • Calculate loan interest in given year in Excel
  • NPV function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles