# How to display first name and last initial in Excel

Join the first word to the first letter of the last word: =TEXTBEFORE(A2," ")&" "&LEFT(TEXTAFTER(A2," ",-1),1)&"." gives "Maria L.".

**Excel:** `=TEXTBEFORE(A2," ")&" "&LEFT(TEXTAFTER(A2," ",-1),1)&"."` (Microsoft 365 only)

**Google Sheets:** `=LEFT(A2,FIND(" ",A2))&LEFT(REGEXEXTRACT(A2,"\S+$"),1)&"."`

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Full name | Display name |
| Maria Lopez |  |
| James O'Neil |  |
| Mary Ann Smith |  |
| Lars Eriksen |  |
| Chidi Okafor |  |
| Aiko Tanaka |  |

Formula in B2, filled to B7: `=TEXTBEFORE(A2," ")&" "&LEFT(TEXTAFTER(A2," ",-1),1)&"."`

Result: Maria L.; James O.; Mary S.; Lars E.; Chidi O.; Aiko T.

## How it works

TEXTBEFORE returns the first name. TEXTAFTER with `-1` returns the last name, and LEFT with 1 keeps its first letter. The period is added as text at the end. Using the last space means middle names are skipped.

## Other ways

- `=LEFT(A2,FIND(" ",A2))&LEFT(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)),1)&"."`: Works in every version: LEFT up to the first space keeps the first name and the space, and the last word comes from the SUBSTITUTE and REPT trick.

## Common mistakes

- Using the first space for the last name turns "Mary Ann Smith" into "Mary A.". Use the last space (instance -1).
- Two people can end up with the same display name ("Maria L." twice). Check with `=COUNTIF($B$2:$B$7,B2)>1`.

## Questions

**How do I show the first initial and last name instead?**

Swap the parts: `=LEFT(A2,1)&". "&TEXTAFTER(A2," ",-1)` gives "M. Lopez".

**How do I do it when first and last names are in separate columns?**

Use `=A2&" "&LEFT(B2,1)&"."`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/first-name-and-last-initial
