Hide Phone Numbers Before Sharing A List

In Formatting•By M. Ichsanul Fadhil•Updated 2026-11-30

You exported a customer list and someone asks for a copy. They need the names to match against their own records. A sheet with live phone numbers in it is not a sheet you should send.

The fix takes one formula. You don't need to delete column A, and you don't need to retype anything. You point a function at each cell and tell it to replace every digit it finds.

Step1

Type The Formula In B2

Excel sheet with names and phone numbers in column A and an empty column B

Click B2 and type this:

=REGEXREPLACE(A2, "[0-9]", "*")

Read it as three parts. A2 is the text to work on. "[0-9]" is the pattern: any single character from 0 to 9. "*" is what takes its place.

Press Enter. B2 now reads Michael Scott (***) ***-****.

The name stayed because letters aren't digits. The parentheses, dashes, and spaces stayed too, for the same reason. Only the ten digits were touched, which is why the result still looks like a phone number with the number blanked out.

Step2

What The Formula Arguments Do

Formula bar showing REGEXREPLACE with the digit pattern and the function arguments popup

Excel shows this popup while you type, and it's worth a glance. The signature is REGEXREPLACE(text, pattern, replacement, [occurrence], [case_sensitivity]).

The first three arguments are required. text is the cell you're reading. pattern is what to find, written in quotes. replacement is what to put there, also in quotes.

The last two are optional and shown in square brackets. occurrence lets you replace only the second or third match instead of every one. case_sensitivity only matters for letters, so it does nothing here.

One thing people trip over: the square brackets in [0-9] are part of the pattern itself, not extra syntax to skip. Type them exactly as written, inside the quotes.

Step3

Fill The Rest Of The Column

Column B filled down with every phone number masked and every name intact

Select B2 and drag the small square at its bottom-right corner down to B6. Every row fills in. The reference to A2 is relative, so each copy reads its own row. B3 reads A3, B4 reads A4, and so on.

Prefer the keyboard? Select B2:B6 and press Ctrl+D. Same result, no dragging.

All five rows now end with (***) ***-**** and keep their names. That's the sheet you can attach to an email.

Two things to know before you send it. The formula only masks what column A holds. Anyone who opens the file can still read column A, so the original numbers are right there. Paste-special the masked column as values into a fresh file if the export is going outside your team. And if another sheet looks customers up by phone number, pointing it at column B returns #N/A for every row. Asterisks don't match a stored number.

Conclusion

One function, three arguments, and a column of phone numbers becomes safe to share. REGEXREPLACE(A2, "[0-9]", "*") matches each digit individually and swaps it for a star, leaving names, brackets, and dashes untouched.

Drag the fill handle to copy it down, or select the range and press Ctrl+D. Either way the formulas stay live, so when a new customer lands in row 7 you drag once more and they're covered too.

Before you send the file anywhere, copy the masked column into a new sheet with Paste Special as values. That way the original numbers aren't sitting in a hidden column behind the asterisks.

Share:

Try It Live in the Sheet

Loading Spreadsheet Playground...Initializing calculation engine
Try It Live Click anywhere to practice with pre-loaded data
Real-World Scenario

You exported the customer contact list to send to a supplier, and every row still has a full phone number sitting there. Names are fine to share. Numbers are not, and there's no time to delete them one by one.

Column B is empty and waiting. Mask every digit in those five numbers so the names survive and the phone numbers don't.

Objectives
#1Mask every digit in B2 so Michael Scott's row reads "Michael Scott (***) ***-****".
#2Fill B3:B6 the same way, so all five rows have a hidden number and a readable name.

Discussion & Questions

Be kind and constructive.
Loading discussion...

You Might Also Like