<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>Excel Do, Dynamic Does : CF, Servertructured References</title><link>http://msmvps.com/blogs/xldynamic/archive/tags/CF/Servertructured+References/default.aspx</link><description>Tags: CF, Servertructured References</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Who Scratched My Table?</title><link>http://msmvps.com/blogs/xldynamic/archive/2010/07/11/who-scratched-my-table.aspx</link><pubDate>Sun, 11 Jul 2010 10:45:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1773659</guid><dc:creator>Bob Phillips</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/xldynamic/rsscomments.aspx?PostID=1773659</wfw:commentRss><comments>http://msmvps.com/blogs/xldynamic/archive/2010/07/11/who-scratched-my-table.aspx#comments</comments><description>&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;One of the better additions to Excel 2007 are, in my view, the functionality added to tables &lt;/span&gt;&lt;a href="http://www.jkp-ads.com/articles/Excel2007tables.asp"&gt;&lt;span style="color:windowtext;text-decoration:none;text-underline:none;"&gt;&lt;span style="font-size:small;"&gt;http://www.jkp-ads.com/articles/Excel2007tables.asp&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;mso-bidi-font-family:Arial;"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;I was recently working on a 2007 project and I was looking to add some highlighting using conditional formatting. That will be easy thought I, but as usual, I was way off the mark.&lt;/span&gt;&lt;/p&gt;
&lt;h2 style="margin:12pt 0cm 3pt;"&gt;&lt;em&gt;&lt;span style="font-size:large;"&gt;Formatting The Table&lt;/span&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;For the sake of clarity, I will not use the actual formatting that I was trying, but a far simpler case.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Figure 1 shows an example of a typical table in Excel 2007.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/1104.Table-Data.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/1104.Table-Data.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;&lt;span&gt;&lt;span style="mso-no-proof:yes;"&gt;Figure 1&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Let&amp;rsquo;s assume that I want to show those rows where the Ship Date has not yet been set, i.e. are showing TBA.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Using conditional formatting, I can easily do that by selecting B2:E8, and then adding a formula of &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;=$F2=&amp;rdquo;TBA&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;and adding an appropriate fill colour.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;To demonstrate this, &lt;span&gt;Figure &lt;span style="mso-no-proof:yes;"&gt;2&lt;/span&gt;&lt;/span&gt; shows the formatted table.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/7041.Table-Data-Standard-CF.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/7041.Table-Data-Standard-CF.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;&lt;span&gt;&lt;span style="mso-no-proof:yes;"&gt;Figure 2&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2 style="margin:12pt 0cm 3pt;"&gt;&lt;em&gt;&lt;span style="font-size:large;"&gt;Using Structured References&lt;/span&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;But hey, this data is in a table, and one of the great features of tables is &lt;/span&gt;&lt;a href="http://office.microsoft.com/en-us/excel-help/using-structured-references-with-excel-tables-HA010155686.aspx"&gt;&lt;span style="font-size:small;"&gt;structured references&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;. So I decided that I would use structured references in my conditional formatting.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;As a demonstration of&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;structured references, &lt;span&gt;Figure &lt;span style="mso-no-proof:yes;"&gt;3&lt;/span&gt;&lt;/span&gt; shows the table with my CF formula off-table.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/2063.Table-Data-With-Formula.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/2063.Table-Data-With-Formula.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;&lt;span&gt;&lt;span style="mso-no-proof:yes;"&gt;Figure 3&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;As you can see, you reference the table, names &lt;i style="mso-bidi-font-style:normal;"&gt;tblShipping&lt;/i&gt; here, and the column, not each individual cell.&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;So clearly, I just have to replace the first CF formula with cell references with this new formula with structured references, &lt;span&gt;Figure &lt;span style="mso-no-proof:yes;"&gt;4&lt;/span&gt;&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;That is what I did, and to my utter surprise, I got the following error.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/7444.Table-Data-CF-Error.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/7444.Table-Data-CF-Error.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;Figure 4&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;As an aside, I did click Help, but I won&amp;rsquo;t bore you with the details on the lack of help that provided, just suffice to say that it was to Excel 2007&amp;rsquo;s usual standard.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;But what can the error be? There is nothing wrong with the formula as &lt;span&gt;Figure &lt;span style="mso-no-proof:yes;"&gt;3&lt;/span&gt;&lt;/span&gt; shows.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;One thing did occur to me. My testing formula was not part of the table, it was outwith the table, whereas CF is part of the table (perhaps, who knows?). If you add that formula to the column next to the table, the table expands to encompass that column, Figure 5.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/2664.Table-Data-With-Embedded-Formula.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/2664.Table-Data-With-Embedded-Formula.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;Figure 5&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Although I used exactly the same formula as before, when the table incorporated the column with that formula, it dropped the table reference, clearly it is superfluous, or implicit.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Armed with all of this, I decided to try that version of the formula in my CF. I still got an error, but a different error&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" align="center"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/3731.Table-Data-CF-Error-v2.png"&gt;&lt;img src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/xldynamic/3731.Table-Data-CF-Error-v2.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="MsoCaption" align="center"&gt;&lt;strong&gt;&lt;span style="font-size:x-small;"&gt;Figure 6&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2 style="margin:12pt 0cm 3pt;"&gt;&lt;em&gt;&lt;span style="font-size:large;"&gt;Conclusion&lt;/span&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;This suggests to me that and formatting added by conditional formatting is not &amp;lsquo;part of the table&amp;rsquo;. And because it is part of the table, it does not work, you cannot use structured references in CF.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;I tried a few variations of the formula, mainly in desperation, but none of these worked either. One interesting aside, when I tried to use a formula with an explicit intersection within the formula embedded in the table, it didn&amp;rsquo;t strip off the table name, I had to use&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;tblShipping[[#This Row],[Ship Date]])=&amp;rdquo;TBA&amp;rdquo; &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;Yet another oddity.&lt;/span&gt;&lt;/p&gt;
&lt;h2 style="margin:12pt 0cm 3pt;"&gt;&lt;em&gt;&lt;span style="font-size:large;"&gt;Summary&lt;/span&gt;&lt;/em&gt;&lt;/h2&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;I have written before about the implementation of conditional formatting in Excel 2007, in &lt;span style="mso-bidi-font-size:11.0pt;"&gt;&lt;a href="http://msmvps.com/blogs/xldynamic/archive/2009/09/08/conditional-formatting-in-excel-2007-chav-or-mini.aspx"&gt;&lt;span style="mso-bidi-font-family:Arial;"&gt;Conditional Formatting In Excel 2007 &amp;ndash; Chav or Mini?&lt;/span&gt;&lt;/a&gt;, and&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;a href="http://msmvps.com/blogs/xldynamic/archive/2009/11/09/openoffice-is-looking-good.aspx"&gt;&lt;span style="mso-bidi-font-family:Arial;"&gt;Open Office Is Looking Good&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt; From these posts, you should be clear that I am far from impressed with conditional formatting in Excel 2007, and unfortunately this looks like another piece of poor implementation.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;It seems that you can conditionally format a table in Excel 2007, but you cannot use structured references in that CF. Okay, so you can use normal CF, but big deal! Why can&amp;rsquo;t we use structured references when applying CF to a table? To my mind, not being able to is a total nonsense, another CF car crash piling up on the others.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;I did also try and use a structured reference in CF on cells not in the table, still no joy.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;If anyone knows how structured reference can be, should be, used, I would love to hear it.&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Arial;mso-bidi-font-size:11.0pt;"&gt;&lt;span style="font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1773659" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/2007/default.aspx">2007</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/Excel/default.aspx">Excel</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/CF/default.aspx">CF</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/Conditional+Formatting/default.aspx">Conditional Formatting</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/Excel+2007/default.aspx">Excel 2007</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/Servertructured+References/default.aspx">Servertructured References</category><category domain="http://msmvps.com/blogs/xldynamic/archive/tags/Tables/default.aspx">Tables</category></item></channel></rss>