NEWExcel AI Agents: use Copilot and Claude in Excel, and prove every number is right. Excel AI Agents course. See the course →

THE TIPS PACK

15 Excel techniques that save hours

Barcodes, timesheets, dropdowns, an automatic table of contents — the small things nobody teaches you. Free, instant, yours to keep.

What’s in the pack

Send it to my inbox

Free, instant, and yours to keep.

No spam, ever. Unsubscribe with one click.
One practical Excel tip a week.

How to Mask Credit Card Numbers in Excel (Show Only 4 Digits)

Watch the 6-minute video or follow the written steps below. The practice file is in the free pack above.

Step-by-step

Masking changes what people see without losing the part you need. In the example, column E holds card numbers in the form 1234-5678-9012-3456, and the goal is a report that shows only four digits.

1. Keep the first four digits with LEFT and CONCAT

Add a header Masked CC 1 in H1. In H2:

=CONCAT(LEFT(E2,4),"***************")

LEFT takes the first four characters, and CONCAT joins them to 15 stars: 12 hidden digits plus three dashes. Double-click the fill handle to copy it down.

2. Or do it with REPLACE and REPT

Add Masked CC 2 in I1. In I2:

=REPLACE(E2,5,15,REPT("*",15))

This starts at character 5, replaces the next 15 characters and puts in 15 stars. REPT saves you typing the stars yourself. Copy it down.

3. Show the last four digits instead

Add Last digits in J1. In J2:

=REPT("*",LEN(E2)-4)&RIGHT(E2,4)

LEN counts every character, digits and dashes included. The formula prints a star for all but the last four, then adds the last four. It works whether or not the numbers have dashes.

4. Turn the formulas into values before deleting the originals

The masked columns are still formulas that read column E. Delete column E and they break. If you want the real numbers out of the file, select the masked column, copy it (Ctrl+C), then right-click > Paste Special > Values. Now the masked text stands on its own and you can safely delete the original column.

YOUR NEXT STEP

Fifteen down. Another hundred to go.

These are the techniques that quietly decide whether Excel is a chore or a tool. None of them takes more than a few minutes to learn, and each one pays for itself the first time a messy file lands on your desk. There are about a hundred more like them.

30-day money-back guarantee, handled by Udemy. No forms, no questions.

★★★★★  Join 80,000+ students

Andreas Exadaktylos · Microsoft-certified Excel instructor · mellontraining.com

WATCHING ON YOUTUBE?

The full courses go further

11 step-by-step courses on Excel, Power BI, Python and AI, all on Udemy with lifetime access.