How to Hide a Cell’s Contents in Excel? [Quick Tip]
Here is a very quick tip if you ever want to hide a cell’s contents in excel
Just use the custom cell formatting (more here) code ;;;
How? (see the screencast aside too)

1. Select the cell you want to hide
2. Hit CTRL+1 (or open format cells dialog from right click)
3. Go to Number tab, select “custom” as the type
4. Type the formatting code as “;;;” without double quotes
5. Press OK and your cell contents are invisible now
What is the use of doing this?
1. This might be handy when you are using conditional formatting to highlight / change cell colors
2. This might be handy when you need to calculate intermediate values, but dont want to display them. (But try to use Hide rows / hide columns feature if you can)
Remember: This formatting code only blanks out the cell contents from being seen. They contents are still there and accessible for formulas, charts as such.
Also know how to display colors in chart data labels using custom cell formatting codes
What is your favorite cell formatting trick?
Have an Excel Question?
| Delicious | Stumble it |
« Converting Excel to PDF – Everything you need to know | Home | Excel Formula 1 – Really Fast way to learn Excel Formulas »
Trackbacks & Pingbacks
- Pingback by Best month ever [blogging updates] | Pointy Haired Dilbert: Charting & Excel Tips - Chandoo.org on July 1, 2009 @ 9:47 am
Comments
RSS feed for comments on this post. TrackBack URI
Leave a comment
If you have an excel or charting question, please ask in the forums Click here to join our discussion forums





Great tip PHD
Hi, Chandoo. I’ve been reading your posts a fairly long time now, and they’re all fantastic. I see you’re making a habit of saving my (professional) life.
) But seriously, this is a great tip. Thanks for sharing it, and many thanks for all your hard work!
Chandoo – this is a neat little trick. I would typically use the color white so the text/numbers do not show. The downside is that someone can highlight the boxes and see the white text. With this trick that issue is solved.
One use that I can think of and do use is for the values in a drop down box (data validation – list). Now you can set the values, but hide them.
thanks Chandoo.
Any idea on how this may work in StarOffice?
Great tip, I always forget about this and it’s good to have the reminder.
One favorite formatting trick that I have is to right-align numbers when some of them are percentages. Typically, if you had the numbers 6.23% and 7.31 in a column, the decimals won’t align because of the percent sign. The percentages get the standard “0.00%” formatting, but for the other numbers, I use: “0.00_%” and everything aligns at the decimal point nicely.
@Michael: Unfortunately I haven’t used staroffice in a really long time.
@all.. anyone, any sun fans out there who are using star office?
Great tip. But there doesn’t seem to be any way to do this with conditional formatting. Too bad. You can do white text.
@Bob.. in 2007 you can do this, but in earlier versions of excel this is not allowed in conditional formatting.
@Michael Pierce: That is a good one.. keeping the alignment right..
@Tony: that is a fun way to use this…
You can’t do it within normal conditional formating.
But you can use some of the conditional functions within custom formats.
For example
[<500]0;;
will display numbers smaller than 500. Anything more than 500 will not display. I worked this out from some custom format instructions on John Peltier’s site.
@Gerald.. you are right… the three sections of the custom format code can be used to define some minimal conditional formatting. For eg. a code like [<500][red]0;[<1000][blue]0;[green]0; would display red, blue and green text based on the value. I have also described an example of it here: http://chandoo.org/wp/2009/01/29/colors-in-excel-chart-labels-trick/
This method highlights the big weakness of Excel’s custom number formatting for me: its failure to properly handle logicals and errors. Try the following format on a range of types:
“positive”;”negative”;”zero”;”text”
You’ll find that numbers are shown using the “positive etc.” labels, (right aligned); text uses the “text” label, left aligned, naturally; errors do not respond to formatting; and logicals are treated with the “text” label, only center aligned. So I’m stuck with using conditional formatting to paint FALSE values white in my spreadsheets (conditional formatting does not allow you to format numbers, only some text and cell attributes)
However, at least I can create an expression that lets me switch FALSE values from invisible to bright red over the whole sheet, for diagnostic purposes, by typing “Y” in a sngle cell
“This formatting code only blanks out the cell contents from being seen. They contents are still there and accessible for formulas, charts as such”
Felt like sharing with you this…
Recently, I was witness to a presentation which just had lines all over in the graph, with no clue as to whether the numbers represented %s or values. It seems that the presenter had inadvertently missed to format the value axis in the graph to display the labels (which had source data formatted “;;;”)
savithri
Hi Chandoo… I tried this, but i am getting a error mesage saying “Microsoft Office Excel cannot use the number format you typed. Try using one of the built-in formats. For more information about custom number formats, click Help”.
Could you please tell me what is wrong that i have done???
@San, are you sure you have typed three ;;; as shown in the pic above? It should accept the format as is. Let me know if you have typed something else.