<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.office.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>Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx</link><description>Yesterday I wrote about some work I was doing with Tables recently. Today I want to do the same for conditional formatting – specifically, using colour scales. (For a refresher, or for those that are new to this blog, you can read up on changes to conditional</description><dc:language>en-US</dc:language><generator>Telligent Community 1.5.134.15456 (Build: 5.5.134.15456)</generator><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7001</link><pubDate>Tue, 25 Jul 2006 18:59:01 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7001</guid><dc:creator>Gareth Horton</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;We develop a product that exports to Excel. &amp;nbsp;In the past, we have not pushed too much of our metadata over to the Excel side, but with the new Open XML formats, we are in the position to do this much more. &amp;nbsp;One of the main areas for this is Conditional Formatting. &amp;nbsp;We are able to define conditional formatting with our product and now push it over to Excel Conditional Formatting rules, rather than just applying the formatting on the cells/ranges themselves.&lt;/p&gt;
&lt;p&gt;Our product is capable of dealing with quite a lot of data, as well as having fairly complex formatting rules. &amp;nbsp;What we found when we started to do this with XLSX is that as with Excel 2003, Excel 2007 remains very buggy in all areas of conditional formatting: display and configuration.&lt;/p&gt;
&lt;p&gt;1. On a fairly up to date machine (18 mths old middle end PC, 1GB RAM) XLS (using BIFF8) or XLSX files with more than 2000-3000 conditional formatting &amp;#39;rules&amp;#39; seems to be the tipping point to poor display performance. We can exceed that very easily with an export from our product. &amp;nbsp; &lt;/p&gt;
&lt;p&gt;2.Whereas OpenOffice.org 2.0 will show similar problems when opening an XLS file with large numbers of conditional formats, once opened, it will outperform Excel 2007 in display performance.&lt;/p&gt;
&lt;p&gt;3.In our efforts to produce creative formulas in XLS to overcome the 3-rule limit, we discovered that the boolean operator OR() will evaluate both of its expressions, even though the first evaluates to true, (as we later confirmed in the Excel 2003 help). Could this be fixed in 2007?&lt;/p&gt;
&lt;p&gt;Seeing as the opening up of the Excel file format to developers (only true Excel dependents such as ourselves tackled native BIFF8) will allow many more applications to create rich, fully featured Excel files, now potentially up to 1 million rows and numerous columns in size, could you review the way Excel handles conditional formatting from a performance perspective.&lt;/p&gt;
&lt;p&gt;The legacy way that conditional formatting is implemented in openxml, might benefit from a different approach, such as using formatting IDs as with traditional xfids, allowing cells to be a member of a cell formatting group, as opposed to a post-display evaluation&lt;/p&gt;
&lt;p&gt;I can certainly generate very complex files for you, if you need them.&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Gareth&lt;/p&gt;
&lt;p&gt;gareth_horton@datawatch.com&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7001" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7002</link><pubDate>Sun, 23 Jul 2006 06:56:50 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7002</guid><dc:creator>Biff</dc:creator><description>&lt;p&gt;I would upgrade just for that one improvement!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7002" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7003</link><pubDate>Sun, 23 Jul 2006 06:33:09 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7003</guid><dc:creator>David Gainer</dc:creator><description>&lt;p&gt;Interesting discussion. &amp;nbsp;Colin, thanks for the explanation. &amp;nbsp;One note – I am sorry to say the “column comparison” is going to be gone in the beta refresh (and for 2007). &amp;nbsp;We turned up some pretty significant bugs recently, and we are past the point where we can do the work required to address them, so that is going to have to wait for the next version. &amp;nbsp;Thanks for the data validation items.&lt;/p&gt;
&lt;p&gt;Biff, I agree with you about the smaller refedits. &amp;nbsp;That’s something I would like to try and solve all over the place in the future.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7003" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7004</link><pubDate>Sat, 22 Jul 2006 23:31:49 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7004</guid><dc:creator>Biff</dc:creator><description>&lt;p&gt;The only gripe I have about CF Formula Is, is that teenie tiny microscopic little box for the formula. Argh!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7004" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7005</link><pubDate>Sat, 22 Jul 2006 23:23:00 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7005</guid><dc:creator>Colin Banfield</dc:creator><description>&lt;p&gt;Is the first instance of a value considered a duplicate? &lt;/p&gt;
&lt;p&gt;A1 = Smith &lt;/p&gt;
&lt;p&gt;A2 = Smith &lt;/p&gt;
&lt;p&gt;Are both cells highlighted or is just A2 highlighted? &lt;/p&gt;
&lt;p&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;A1 = 1 &lt;/p&gt;
&lt;p&gt;A2 = 1 &lt;/p&gt;
&lt;p&gt;A3 = 1 &lt;/p&gt;
&lt;p&gt;A4 = 2 &lt;/p&gt;
&lt;p&gt;A5 = 3 &lt;/p&gt;
&lt;p&gt;Would the bottom 3 be A1:A3 or A1:A5 ?&lt;/p&gt;
&lt;p&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;A1 = 1 &lt;/p&gt;
&lt;p&gt;A2 = 1 &lt;/p&gt;
&lt;p&gt;A3 = 1 &lt;/p&gt;
&lt;p&gt;A4 = 1 &lt;/p&gt;
&lt;p&gt;A5 = 3 &lt;/p&gt;
&lt;p&gt;Would the bottom 3 be A1:A4 ? &lt;/p&gt;
&lt;p&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7005" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7006</link><pubDate>Sat, 22 Jul 2006 23:09:39 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7006</guid><dc:creator>Biff</dc:creator><description>&lt;p&gt;How does Excel 2007 conditional formatting handle these:&lt;/p&gt;
&lt;p&gt;** highlight cells containing duplicates&lt;/p&gt;
&lt;p&gt;Is the first instance of a value considered a duplicate?&lt;/p&gt;
&lt;p&gt;A1 = Smith&lt;/p&gt;
&lt;p&gt;A2 = Smith&lt;/p&gt;
&lt;p&gt;Are both cells highlighted or is just A2 highlighted?&lt;/p&gt;
&lt;p&gt;** Top/botton N lists&lt;/p&gt;
&lt;p&gt;Are &amp;quot;ties&amp;quot; accounted for?&lt;/p&gt;
&lt;p&gt;A1 = 1&lt;/p&gt;
&lt;p&gt;A2 = 1&lt;/p&gt;
&lt;p&gt;A3 = 1&lt;/p&gt;
&lt;p&gt;A4 = 2&lt;/p&gt;
&lt;p&gt;A5 = 3&lt;/p&gt;
&lt;p&gt;Would the bottom 3 be A1:A3 or A1:A5 ?&lt;/p&gt;
&lt;p&gt;Or:&lt;/p&gt;
&lt;p&gt;A1 = 1&lt;/p&gt;
&lt;p&gt;A2 = 1&lt;/p&gt;
&lt;p&gt;A3 = 1&lt;/p&gt;
&lt;p&gt;A4 = 1&lt;/p&gt;
&lt;p&gt;A5 = 3&lt;/p&gt;
&lt;p&gt;Would the bottom 3 be A1:A4 ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7006" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7007</link><pubDate>Sat, 22 Jul 2006 18:09:43 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7007</guid><dc:creator>Colin Banfield</dc:creator><description>&lt;p&gt;Biff, the “Formula Is” equivalent is also easy to find in Excel 2007. You select New Rule from the Conditional Formatting menu (which displays after you click the Conditional Formatting button on the Ribbon). In the New Formatting Rule dialog box, there&amp;#39;s a list of rule types and one of these is &amp;quot;Use a formula to determine which cells to format.&amp;quot;&lt;/p&gt;
&lt;p&gt;I suspect that the real concern being alluded to is contained in the &amp;quot;...and hard to use&amp;quot; part. Except for providing examples in a help window, I don&amp;#39;t know how the UI could make using specific formulas in conditional formatting more &amp;quot;discoverable.&amp;quot; For example, how can the UI expose the fact that a formula like =COUNTIF($A$1:$A$10,A1)&amp;gt;1 highlights duplicates in the selected range A1 to A10? From this perspective, formulas would appear &amp;quot;hard to use.&amp;quot; However, what you can do is figure out the most common conditions that folks use conditional formatting formulas for and expose these conditions as highlighting options in the IU, thus making these specific conditions “discoverable.”&lt;/p&gt;
&lt;p&gt;In this respect, Excel 2007 does a reasonably good job. For example, on the Conditional Formatting menu you can choose to highlight cells containing duplicates, unique values, top N items, top N %, bottom N items, bottom N %, above average, below average and 1 to 3 standard dev above or below average. &amp;nbsp;You can highlight cells with dates occurring today, yesterday, tomorrow, last 7 days, next month and so on. &amp;nbsp;You can highlight cells with text containing, not containing, beginning with &amp;amp; ending with. &amp;nbsp;You can highlight cells with blanks, non-blanks, errors or no errors. &amp;nbsp;Finally, there’s a column comparison option available to Tables. &amp;nbsp;To highlight cells with any of the preceding conditions in earlier versions of Excel, you&amp;#39;d need to use formulas, and this is where discoverability becomes an issue for most folks. &amp;nbsp;In Excel 2007, there should be far less need to use formulas at all.&lt;/p&gt;
&lt;p&gt;On a related note, it’s unfortunate that Data Validation wasn’t a similar beneficiary of any new conditions in Excel 2007. &amp;nbsp;For example, the ability to use UDFs directly in data validation formulas (the workaround to reference a UDF in a worksheet cell is lame and doesn’t work if you want to apply the UDF to a bunch of input cells). Also, I’d have liked to see a “like” operator, so that you could validate a specific input string format.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7007" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7008</link><pubDate>Sat, 22 Jul 2006 05:05:00 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7008</guid><dc:creator>Biff</dc:creator><description>&lt;p&gt;&amp;quot;the &amp;quot;Formula Is&amp;quot; functionality is hidden, and hard to use&amp;quot;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know about Excel 2007, but in earlier versions it&amp;#39;s not hidden at all and is exactly where you would think it should be, under Format. It&amp;#39;s &amp;quot;easy&amp;quot; to use. In fact, I use &amp;quot;Formula Is&amp;quot; exclusively. I never use &amp;quot;Cell Value Is&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;quot;use &amp;quot;Formula is&amp;quot; and return TRUE or FALSE based on that formula&amp;quot;&lt;/p&gt;
&lt;p&gt;Using a logical comparison that returns a boolean is the most common method, however, you can use any formula expression that returns a numeric value as well. Any numeric value other than 0 will be evaluated as TRUE and the format will be applied. A numeric return of 0 will be evaluated as FALSE and the format will not be applied. A very simple example would be:&lt;/p&gt;
&lt;p&gt;=COUNTIF(A$1:A$10,&amp;quot;x&amp;quot;)&lt;/p&gt;
&lt;p&gt;If the result was 0 no format would be applied.&lt;/p&gt;
&lt;p&gt;If the result was 7 the format would be applied. &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7008" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7009</link><pubDate>Fri, 21 Jul 2006 21:08:07 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7009</guid><dc:creator>David Gainer</dc:creator><description>&lt;p&gt;Andrew, check out this post for some VBA examples:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/excel/archive/2005/10/14/481237.aspx"&gt;blogs.msdn.com/.../481237.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7009" width="1" height="1"&gt;</description></item><item><title>re: Fun With Conditional Formatting</title><link>http://blogs.office.com/b/microsoft-excel/archive/2006/07/19/fun-with-conditional-formatting.aspx#7010</link><pubDate>Fri, 21 Jul 2006 17:12:18 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:7010</guid><dc:creator>Andrew</dc:creator><description>&lt;p&gt;How do I programmatically add a formatting rule? For example, I would like to create a macro that creates a number of formatting rules that can be used later by the user or write an Add-In that generates formatting rules. Does the Excel Object Model include these rules?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=7010" width="1" height="1"&gt;</description></item></channel></rss>