<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MikeKelly's WebLog : excel</title><link>http://blogs.msdn.com/mikekelly/archive/tags/excel/default.aspx</link><description>Tags: excel</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Excel Conditional Formatting Against a Goal Value</title><link>http://blogs.msdn.com/mikekelly/archive/2008/12/30/excel-conditional-formatting-against-a-goal-value.aspx</link><pubDate>Wed, 31 Dec 2008 02:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9257773</guid><dc:creator>MikeKelly</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mikekelly/comments/9257773.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikekelly/commentrss.aspx?PostID=9257773</wfw:commentRss><description>&lt;P&gt;Today, for a metrics worksheet I'm doing, I had a conditional formatting problem with Excel.&amp;nbsp; I suspect this is a pretty common problem.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I had a column of numbers showing the monthly results for a set of metrics (the rows) for this fiscal year, and I had an annual goal for each metric.&amp;nbsp; I summed up the values across the months that have passed in this FY (our FY starts in July).&amp;nbsp; I hid the columns for the months that haven't come yet.&amp;nbsp; Then I have an annual goal for each metric.&lt;/P&gt;
&lt;P&gt;I want to use conditional formatting to show whether I am on track to meet the metric.&amp;nbsp; An Icon Set format should do nicely, but at first I was puzzled because it looked like I could only use an icon set against the value itself - but in fact, I wanted to compare the value to the goal.&lt;/P&gt;
&lt;P&gt;I realized after playing around a bit that the trick is to add a column for the icon and use a formula in that column to compare the value so far against the goal, and then format that column with the icon set, chosing "Show Icon Only" in the conditional formatting dialog.&amp;nbsp; What I end up with is something like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.romascokelly.com/images/ExcelConditionalFormatExample.JPG" mce_src="http://www.romascokelly.com/images/ExcelConditionalFormatExample.JPG"&gt;&lt;/P&gt;
&lt;P&gt;Because the value in the Total column (I'm not dealing with conditional formatting for the metrics where I'm showing averages) is only for a part of the FY, but the total goal is for the entire year, I need to scale the comparison to say whether we are on track or not.&amp;nbsp; This involves a bit of date arithmetic to figure out how far into the year we are.&amp;nbsp; Here's the formula; this complex parenthesized expression is basically figuring out how far we are into the FY, as a fraction from 0 to 1 (i.e. in the first month, we will be at 1/12).&amp;nbsp; Note that I am using TODAY() to get today's date; if instead, you wanted to make this be a specific date, i.e. the end of the month, you could create another named cell into which you enter the date for which metrics are current and refer to that in this formula instead of TODAY().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;=(((YEAR(TODAY())-YEAR(FYStart))*12+(MONTH(TODAY())-MONTH(FYStart)+1)/12)&lt;/P&gt;
&lt;P&gt;I created a workbook with two named cells, one with the starting date of the Fiscal Year (which I named FYStart) and below it a cell with this formula in it, which I named PercentOfYear.&amp;nbsp; I can then refer to those named cells in formulas elsewhere.&amp;nbsp; This lets me reuse this sheet next year by just changing the FY start date.&lt;/P&gt;
&lt;P&gt;Now to figuring out how far off I am from the goal.&amp;nbsp; For each row,&amp;nbsp;column "N"&amp;nbsp;is the value so far, i.e. the total of the values for all the months that have passed in this FY.&amp;nbsp; The "O" column will contain the icon showing on track or not.&amp;nbsp; The "P" column has the goal.&amp;nbsp; The formula for the icon column (O) is:&lt;/P&gt;
&lt;P&gt;=(N4-PercentOfYear*P4)/(PercentOfYear*P4)&lt;/P&gt;
&lt;P&gt;This scales the entire FY goal to what it should be this month if we are on track (this assumes the metric increases linearly each month).&amp;nbsp; We then subtract the scaled goal from the actual value, which gives us a positive value if we are ahead of the FY goal at this point, a negative number if we are below the goal at this point, and zero if we are right on target for the goal.&amp;nbsp; We then scale how far we are off from the goal by the scaled goal - so for instance, if the metric value is "2" and the goal is "5" and we are in December, we will should be at 2.5; because we are at 2, we are off by .5 or 20% of the scaled goal.&lt;/P&gt;
&lt;P&gt;Finally, we apply conditional formatting to the cells using a custom rule.&amp;nbsp; That looks like this:&lt;/P&gt;&lt;IMG src="http://www.romascokelly.com/images/ExcelConditionalFormatExample2.JPG" mce_src="http://www.romascokelly.com/images/ExcelConditionalFormatExample2.JPG"&gt; &lt;BR&gt;
&lt;P mce_keep="true"&gt;This applies a green icon if the value is zero or positive - i.e. we are on track for the goal; yellow if the value is not less than 25% below the goal at this point; red if we are further below the goal than that.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9257773" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikekelly/archive/tags/excel/default.aspx">excel</category></item><item><title>Showing a Checkmark in Excel</title><link>http://blogs.msdn.com/mikekelly/archive/2007/08/30/showing-a-checkmark-in-excel.aspx</link><pubDate>Thu, 30 Aug 2007 21:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4652263</guid><dc:creator>MikeKelly</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/mikekelly/comments/4652263.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mikekelly/commentrss.aspx?PostID=4652263</wfw:commentRss><description>&lt;P&gt;I had a problem that was surprisingly not easy to do in Excel, and since it seems like&amp;nbsp;a pretty common thing, I thought I'd provide a note here on how to do this.&lt;/P&gt;
&lt;P&gt;Problem: With Excel 2007, you want to display a "checkmark" or a "red x" in a column that has a logical value - i.e. if the value is TRUE then display a checkmark, if it is FALSE then display a red X.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Excel 2007 has some really nice new conditional formatting options, one of which is "Icon Sets".&amp;nbsp; This would seem to totally do the trick, but it takes thinking about this problem a bit differently to get it right.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Icon sets are all based around numeric values, not logical values.&amp;nbsp; So my mistake was thinking that for what is really boolean data - true or false - I should, well, put TRUE or FALSE in the column.&amp;nbsp;&amp;nbsp; Nooooooo...&amp;nbsp; Instead, put a non-zero numerical value (e.g.1, or 10 or 100) in the column if you want to show a checkmark.&amp;nbsp; Put zero if you want to show a RED X.&amp;nbsp; Then select the column or cells, go to Conditional Formatting and select Icon Set, then select the set that has the red x, the checkmark, etc.&lt;/P&gt;
&lt;P&gt;With the columns or cells still selected, go back to conditional formatting and select "Manage Rules".&amp;nbsp; You'll see a rule called "Icon Set" in the list.&amp;nbsp; Select that and click Edit Rule.&amp;nbsp; Now check the check box "Show Icon Only" - that way you don't see your values, just the checkmark or the red X.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4652263" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mikekelly/archive/tags/excel/default.aspx">excel</category></item></channel></rss>