Make a label with a masked surname

Turn Ava and Reed into Ava R*** for name tags and public lists.

What you'll make

In Excel: Ava + Reed becomes Ava R***.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TRIM(B8)=""Checks whether the surname is empty.Not empty
2TRIM(A8)Shows the given name alone when there's no surname.Not used for row 8
3TRIM(A8)&" "&LEFT(…)The given name, a space and the surname's first letter."Ava R"
4REPT("*", … )One star for each other letter of the surname."***"
5IF( … )Picks the given name alone or the masked label."Ava R***"

Read it left to right. Part 3 includes the space between the names. Spaces inside a surname get a star too.

=IF(TRIM(B8)="",TRIM(A8),TRIM(A8)&" "&LEFT(TRIM(B8),1)&REPT("*",MAX(0,LEN(TRIM(B8))-1)))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up names with the formula already in.
  2. Use your own names. Paste given names into column A of the Template tab and surnames into column B. Labels fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

The full names are still in columns A and B. Remove them before you share the labels.

Route: Get names ready for the letter

Microsoft's help: REPT function