Skip to main content

How to only hide part of cell value in Excel?

Author Sun Last modified
A screenshot showing partially hidden social security numbers in Excel
Supposing you have a sheet with some general information about the staff, but some are private such as social security numbers. Now you want to hide part of these social security numbers as below screenshot shown, how can you quickly solve it?

Partially hide social security numbers with Format Cells

Partially hide text or number with formulas

arrow blue right bubble Partially hide social security numbers with Format Cells

To hide part of social security numbers in Excel, you can apply Format Cells to solve it.

1. Select the numbers you want to hide partially, and right click to select Format Cells from context menu. See screenshot:
A screenshot of the Format Cells option in Excel

2. Then in the Format Cells dialog, click Number tab, and select Custom from Category pane, and go to enter this 000,,"-**-****" into the Type box in right section. See screenshot:
A screenshot of the Format Cells dialog

3. Click OK, now partial numbers you selected have been hidden.

Note: it will round up the number if the forth number is larger than or eaqul to 5.

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

arrow blue right bubble Partially hide text or number with formulas

With above method, you only can hide partial numbers, if you want to hide partial numbers or texts, you can do as below:

Here we hide first 4 numbers of the passport number.

Select one blank cell next to the passport number, F22 for instance, enter this formula ="****" & RIGHT(E22,5), and then drag autofill handle over the cell you need to apply this formula.
A screenshot showing the Excel formula used to partially hide passport numbers by masking digits

Tip:

If you want to hide last four numbers, use this formula, = LEFT(H2,5)&"****"

f you want to hide middle three numbers, use this =LEFT(H2,3)&"***"&RIGHT(H2,3)

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!