Sometimes you want to turnoff decimal points if the value after point is 0. Mireya, Chandoo.org member had one such situation. She writes:
I am a complete beginner in excel, how can I keep the zeros when I am working with decimals and remove them when are not required, ie
Thanks for your kind help.
Easy way: Use General Formatting
The default cell formatting in Excel is General. When you set a cell’s formatting to General, you are telling Excel,
Don’t bother me. Just figure it out.

And being a good Samaritan, Excel shows decimal point if there is something after it, else omits it.
See the demo aside to understand this.

What if your numbers are results of a calculation?
It doesn’t matter. General formatting takes good care of the cells. It shows and hides decimal point depending on the result of your formulas.
What if you want something fancy like accounting format, but turn off decimal values
Now you are talking. The General Formatting option shows numbers as typed (or calculated). So 124578395 would look like 124578395 instead of $ 12,45,78,395.
So how do you show $1,245 and $1,246.34?
Aside: You should always show decimal points if some values have them and others don’t. The below technique is useful when data is a result of calculation. For example: In a dynamic KPI report, for certain KPIs you may want to show decimal points, and omit for others.

To show decimal point if there is something after it

Just follow below steps:
- Select the cell(s) where you want this formatting.
- Go to Conditional Formatting > New rule from home ribbon.
- Select rule type as “Use a formula…”
- Check if there is a value after decimal point using a formula like =Mod(A1,1)>0
- Click the format button
- Go to “Number” tab and Apply formatting with 2 decimal places.
- Click OK & You are done!
Now, if the cell has a decimal value, it shows, otherwise the decimal point is omitted.
Related: Conditional formatting Basics
Do you deal with such situations when formatting numbers?
Often when making reports (or dashboards), I have a cell where any data can go, based on user selection. In such cases, I use conditional formatting to define how it looks based on the data. Sometimes, I also use TEXT formula to format the data. This is more suitable when data is displayed in a text box rather than a cell.
What about you? Do you face situations like this? How often you rely on General formatting? Please share your experience and tips using comments.
More on Number formatting in Excel
Understanding how Excel formats numbers (and other values) can save you lots of time when you are designing dashboards, reports or workbooks that need to presented. Check out below articles to get few more tips.
- Introduction to number formatting in Excel and 10 tips
- Preserving leading zeros in a number using formatting
- Display decimals only if the value is less than 1
- How to hide “0” in chart axis labels?
- How to hide cell’s contents using format codes?
- Adding colors to your chart labels using custom format
- Showing Indian Currency Format in Excel [and more on this]
- Develop & understand custom number formats
- Chart Axis formatting – Part 1 & Part 2

















25 Responses to “Display Alerts in Dashboards to Grab User Attention [Quick Tip]”
I prefer the red,grey,light grey,black icon set. I've also used in-cell pie charts from Fabrice's Sparklines for Excel as an alert which could also provide another piece of information.
I prefer the red,grey,light grey,black icon set. I've also used in-cell pie charts from Fabrice's Sparklines for Excel as an alert which can also provide another piece of information.
For Excel 2007, your formula should do the same as the Excel 2003 version, so that non-alert rows are blank - if they are 0, the unnecessary green icon will show
Hi Chandoo,
Nice Post !! just to add something for EXL 2003, we can also 4 Ifs and link to the alert data
For Ex: If we have alert data in Cell A2 and want to split in 4 orders namely <25%, 25-50%, 50-75% and 75%< then we can following formula and put fonts as you have suggested :
=IF(A2<0.25,CHAR(153),IF(A2<=0.5,CHAR(155),IF(A2=0.76,CHAR(152)))))
And then using Conditional Formating we can dashboard reflected on different COLOURS as per their respective alert.
Best Regards
Rohit1409
Hi Chandoo,
Nice Post !!! just to add something for EXL 2003, we can also 4 Ifs and link to the alert data
For Ex: If we have alert data in Cell A2 and want to split in 4 orders namely <25%, 25-50%, 50-75% and 75%< then we can following formula and put fonts as you have suggested :
=IF(A2<0.25,CHAR(153),IF(A2<=0.5,CHAR(155),IF(A2=0.76,CHAR(152)))))
And then using Conditional Formating we can dashboard reflected on different COLOURS as per their respective alert.
Best Regards
Rohit1409
The Complete formula [Don't Know how it got cut ]
=IF(A2<0.25,CHAR(153),IF(A2<=0.5,CHAR(155),IF(A2=0.76,CHAR(152)))))
PS : Use in single line [I have split it to avoid cuts 😉 ]
Hi Chandoo..
why it is not displaying the complete formula..
anyways here is the balance
"=IF(A2<0.25,CHAR(153), IF(A2<=0.5,CHAR(155), IF(A2=0.76,CHAR(152)))))"
@Rohit... your formulas are fine. Just that the width of comment area is fixed and hence my website is cropping it at 640pixels. I just edited your formula and added few white spaces so that it wraps nicely.
Very good idea btw.. kudos!
Hi,
Maybe just go for 'bold' ; 'underline' or 'italic' to draw the users attention? Those methods (if those can be called methods) are used cross media type (books, journals, blogs, billboards, ...) to guide the readers eye to valuable information.
Just a basic thought
@Tom.. good idea..
[...] has a very nice writeup on how to add such alerts to dashboard sheets. Possibly related posts: (automatically generated)Divide your data set into workbooksHow to enforce [...]
Hi Chandoo,
You certainly grabbed my attention! although I wasn't sure what my brother (Suresh) and cousin (Shyam) were doing right, and I was doing wrong? 😉
I love your blog btw - Many thanks for all your hard work in unravelling the secrets and mysteries of Excel!
Best regards
Ramesh
I thought I saw an advertisment for a book about learning excel called excel himalaya or something. It cost about 35.00 us money but seemed to have the things I need to have my admin assistant to start to use. I was hoping to start with this book and then send her to school if she shows some interest and aptitude. Any help on this would be appreciated. Thanks
Great web site and information!!!!
@Jeff... checkout http://chandoo.org/wp/2010/08/25/excel-everest-review/
thanks, your website is awesome!
[...] Alerts to highlight focus areas [...]
[...] There are lots of numbers in this dashboard. I would suggest adding few more visualizations like showing indicators or applying conditional formatting or replacing a table with a chart. This would reduce the [...]
[...] is the same technique as alert icons in dashboard. Just that I also showed green [...]
[...] is the same technique as alert icons in dashboard. Just that I also showed green [...]
Hi Chandoo
Firstly thanks for all the cool tips on how to use Excel better.
I am new to the site and have a question which you may be able to assist with but dont know if these comment boxes are the best way of asking ?
I am looking at assets and trying to calculate the depreciation total by taking a year (say 2010) adding the expected life of the asset (say 10 years) then comparing that to a future date (say 2015) using an IF statement. The calculation in normal is - IF((year in col B (2010) plus 10years)>year 2015, add a years depreciation, otherwise leave blank). The converted date value does not appear able to add 10 years in order to compare it to 2015. Am I missing something ?
I use the “IF” Statement in conjunction with Conditional Formatting in MS Excel to give verbiage to alert one of a required action, dependant on a review date. This makes a visual stimulus, plus it clues one as to what the conditional format is trying to warn you about and what follow-up actions are required.
Wow, I'm really impressed with dashboards. I had no idea this stuff was even possible with excel. I'd like to offer an interactive dashboard to my customers, showing analytics of their data. I have a .pdf file with the datapoints. I'd like them to enter the data on my website, and be able to see their data. Is something like that possible.
Hi Chandoo,
I've recently purchased the package for both templates.
In the portfolio dashboard,under the calculations worksheet, I'm attempting to change the date range in the gantt chart to show only the range of the project that starts in late 2013. How do I do this?
Thanks
Adam
[...] is the same technique as alert icons in dashboard. Just that I also showed green [...]
Hi Chandoo,
I'm new at Excel Dashboard and found your blog really useful and helpful! It's very nice of you that you dedicate your time to do this.
Could you please explain how can I use Alerts based on dates on a Dashboar?
For example, if a target date is coming closer to the actual date, the alert is yellow or red.
I'd really appreciate some help!
Thank you
Where can I download the file Excel of Averall Statistics ???
Thanks a lot.