Anyone who has made a pivot table and their grandma knows that formatting them is a pain. Let’s recap the steps to apply one of the most common formats – currency format.
- Right click on any value field
- Go to Value field settings
- Click on “Number Format” button
- Choose Currency format
- Close the boxes, one after another
Unless you get paid per click, you wont be happy with all those clicks.
Wouldn’t it be cool to just click once and apply most common format to your pivot fields?

Of course you can. Just add oneClickCurrency macro to your personal macros workbook. And then add this to your Home ribbon as a custom button and you have a one click format option for any pivot.

oneClickCurrency Macro
So are you ready for the code? Its so tiny, you could type it faster than manually formatting the pivot fields yourself 😉
Sub oneClickCurrency()
On Error GoTo GameOver
Dim pName As String, pfName As String
pName = ActiveCell.PivotTable.Name
pfName = ActiveCell.PivotField.Name
With ActiveSheet.PivotTables(pName).PivotFields(pfName)
.NumberFormat = "$#,##0.00"
End With
GameOver:
End Sub
When copy pasting this code to your personal macros workbook, change the $#,##0.00 format code to any other formatting you want to use. Here are a few more common ones.
- Accounting format (negative values in brackets, no zeros): _($* #,##0.00_);_($* (#,##0.00);_($* “”-“”??_);_(@_)
- Negative amounts in red color: $#,##0.00;[Red]$#,##0.00
- Amounts with no decimals: $#,##0
So there you go. I just save you from a massive tax. Click tax that is.
George Costanzaesque macros for you
Short & fun, that is how I like my macros. Here are a few you should add to your personal macros workbook to save time & get more out of Excel.
- Filter a table by selected criteria
- Add a popup calendar to any cell
- Highlight selected cell’s row & column
- Split text to multiple cells
- More VBA Examples
How do you format your pivots?
For most of my work, I rely on Power Pivot, which allows you to set up format options when defining a measure. But whenever I use pivots, I end up paying click tax for the formatting. Hence the macro.
What about you? How do you format your pivots? You can customize the above macro to include additional steps that you often do (changing layouts etc.) Please share your techniques & thoughts in the comments section.

















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.