How to Hide a Part of Text in Excel Cells (2 Methods)

Dataset Overview

Let’s assume we have a dataset of 5 employees’ phone numbers. But we don’t want to show it to everyone. So, we need to hide some part of the text of the phone number cells. You can accomplish this result using any of the following methods.

Sample Dataset to Hide Part of Text in Excel Cells


Method 1 – Custom Format

  • Select the dataset (e.g., cells C5 to C9) where you want to hide parts of text.
  • Right-click and choose Format Cells.

Select Dataset to Apply Custom Format

Access the Format Cells Dialogue Box

  • In the Format Cells window, select Custom from the Category pane.
  • In the Type box, enter the format:

"+"164"**-***-***"

  • Click OK to hide the phone numbers while maintaining a certain sequence.

Apply Custom Format to Hide Part of Text in Excel Cells

Dataset with Hidden Parts


Method 2 – Excel Functions

2.1 Hide Right Part of Text Using LEFT Function

  • Create a new column (e.g., Output) to apply formulas.

Create New Column to Get Output

  • For the first 6 digits of the phone number, enter the following formula in cell D5:
=LEFT(C5,6)&"******"
  • Press Enter.
  • As a result, you will get the phone number with the first 6 digits and the rest hidden as star (*) marks.

Use the LEFT Function to Hide Right Part of Text in Excel Cells

  • Drag the formula down to apply it to other cells.

Drag the Fill Handle Below to Copy Same Formula

As a result, you will get all your employees’ phone numbers with some hidden parts. The output will look like this.

Result with Hidden Parts


2.2 Hide Left Part of Text Using RIGHT Function

To show only the last 3 digits:

  • Click on cell D5.
  • Enter the following formula in the formula bar:
="*********"&RIGHT(C5,3)
  • Press Enter.

Use the RIGHT Function to Hide Left Part of Text in Excel Cells

  • Drag the formula down to apply it to other cells.

Drag Fill Handle Below to Copy Same Formula

The first part of the phone number is hidden and only the last 3 digits are visible for each employee’s phone number.

Output with Hidden Parts


2.3 Hide Left & Right Part of Text Using MID Function

To only show the middle digits:

  • Click on the D5 cell.
  • Enter the following formula in the formula bar.
="*****"&MID(C5,6,3)&"****"
  • Press Enter.

Use the MID Function to Hide Left & Right Part of Text in Excel Cells

  • The first and last part of the cell value have been hidden and only 3 digits from the middle is showing.
  • Drag the formula down to apply it to other cells.

Drag Fill Handle Below to Copy Same Formula

The first and last parts of all the phone numbers for all employees have been hidden.

Phone Numbers with Hidden Parts

Read More: How to Hide Confidential Data in Excel


How to Hide Full Text in Excel Cells

  • Choose the range of cells you want to hide (for example, C5 to C9).
  • Right-click on the selected cells.

Select Dataset to Hide Full Text

  • From the Context Menu, choose Format Cells.

Choose Format Cells Option to Apply Custom Format

  • In the Format Cells dialog box, select the Custom option from the Category pane.
  • In the Type box, enter three consecutive semicolons (;;;).
  • Click OK.

Custom Format to Hide Full Text in Excel Cells

  • The full text of the cells will be hidden. The values remain in the cell but are not displayed. For example, the result will look like this:

Dataset with Hidden Texts

Read More: Hide Data in Excel


Download Practice Workbook

You can download the practice workbook from here:


Related Articles


<< Go Back to Hide Cells | Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjim Reza
Tanjim Reza

Md. Tanjim Reza Tanim, a BUET graduate in Naval Architecture & Marine Engineering, contributed over one and a half years to the ExcelDemy project. As an Excel & VBA Content Developer, he authored 100+ articles and, as Team Leader, reviewed 150+ articles. Tanim, leading research, ensures top-notch content on MS Excel features, formulas, solutions, tips, and tricks. His expertise spans Microsoft Office Suites, Automating Finance Templates, VBA, Python, and Developing Excel Applications, showcasing a multifaceted commitment to the... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo