Text Functions
Intermediate

REPLACE Function

Replace characters at a specific position using REPLACE.

Task:

Mask the first 5 characters of credit card numbers with asterisks for privacy. Display the masked numbers in column B.

Learning Objectives:

  • Learn REPLACE function
  • Understand position-based replacement
  • Practice data masking
Hints

Solve without hints for +5 XP

Interactive Spreadsheet

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

AB
1IDRedacted ID
2123456789
3987654321
4555551212
What this exercise teaches (contains the answer)

REPLACE replaces a specified number of characters in a text string, starting at a specified position, with new text.