CAMPUS ALERT

Bellevue University Tops U.S. News Rankings

Display the last four digits of Social Security number, credit card number etc..in Excel

Let us say, for common security measures, you want to display only the last four digits of an identification or Social Security number, credit card number, or other number and replace the rest of the digits with asterisks. Whether the digits in your cell are formatted as text, numbers, or the special Social Security number format, you can use the same functions. To display only the last four digits of identification numbers, use the CONCATENATE, RIGHT, and REPT functions.

Security: In the example, you should hide column B and protect the worksheet so that the original data cannot be viewed.

A

B

1

Type

Data

2

Social Security Number

555-55-5555

3

Credit Card Number

5555-5555-5555-5555


Formula

Description (Result)

=CONCATENATE("***-**-", RIGHT(B2,4))

Combines the last four digits of the SSN with the "***-**-" text string (***-**-5555)

=CONCATENATE(REPT("****-",3), RIGHT(B3,4))

Repeats the "****-" text string three times and combines the result with the last four digits of the credit card number w(****-****-****-5555)

Thanks for your interest in Bellevue University.

When you click the submit button below, our staff will contact you within 48 hours to get you the information you need and answer any questions.

Yes No