<?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>A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx</link><description>I’m sure many of you have built a spreadsheet like this before: you’ve got a table of data; one of the columns in this table contains a formula which references a span of columns in the same table. The number of columns you need to reference may change</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>A Robust Way To Reference Multiple Columns In a Table | Microsoft Share Point</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9539724</link><pubDate>Thu, 09 Apr 2009 10:47:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9539724</guid><dc:creator>A Robust Way To Reference Multiple Columns In a Table | Microsoft Share Point</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoft-sharepoint.simplynetdev.com/a-robust-way-to-reference-multiple-columns-in-a-table/"&gt;http://microsoft-sharepoint.simplynetdev.com/a-robust-way-to-reference-multiple-columns-in-a-table/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9542804</link><pubDate>Fri, 10 Apr 2009 12:14:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9542804</guid><dc:creator>sam</dc:creator><description>&lt;p&gt;Joseph,&lt;/p&gt;
&lt;p&gt;Why cant we simply have a LastRow or LastCol Function which returns the value/Address of the LastRow or LastCol in the row or column.&lt;/p&gt;
&lt;p&gt;So Sum(A1:LastRow(A)) would give me sum of all &lt;/p&gt;
&lt;p&gt;cells from A1:Upto As much as there is data&lt;/p&gt;
&lt;p&gt;=LastRow(A) gives me the value in the last row&lt;/p&gt;
&lt;p&gt;Currently I have to do this through a UDF&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9544005</link><pubDate>Fri, 10 Apr 2009 23:46:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9544005</guid><dc:creator>Joseph Chirilov</dc:creator><description>&lt;p&gt;sam: It's an interesting idea. It would work for the simple example above, but not so for a more complex table. For example, the idea for this post came as I was creating a scheduling spreadsheet, and I had a span of columns to represent individual developers, and another span of columns to represent individual testers. I needed to do calculations based on the entire set of developers and testers independently. A LastCol function would not have worked for me in this case.&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9547353</link><pubDate>Tue, 14 Apr 2009 01:04:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9547353</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;This technique also works when referencing data in multiple tabs in an Excel workbook&lt;/p&gt;
&lt;p&gt;example: sum(starttab:endtab!A1)&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9548751</link><pubDate>Tue, 14 Apr 2009 19:31:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9548751</guid><dc:creator>Joseph Chirilov</dc:creator><description>&lt;p&gt;Good point, Tim. &amp;nbsp;It sure does.&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9552791</link><pubDate>Thu, 16 Apr 2009 15:36:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9552791</guid><dc:creator>Steve Edwards</dc:creator><description>&lt;p&gt;Why not use the OFFSET function inside your SUM or COUNT to point to the changing range? The HEIGHT and WIDTH arguments can be used to refer to any area. &lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;SUM(OFFSET(A1,,,1,4))&lt;/p&gt;
&lt;p&gt;Returns the total of the range starting from A1 and continuing 4 columns across to the right along the same row (The HEIGHT is 1 and the WIDTH is 4) Enter the Width argument as a cell reference and by changing the cell value you can refer to any area. &lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9553886</link><pubDate>Fri, 17 Apr 2009 08:54:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9553886</guid><dc:creator>Joseph Chirilov</dc:creator><description>&lt;p&gt;Steve: thanks for the suggestion. That works too, but for my way of working with Excel it's a bit more cumbersome as I'd have to remember to update the cell that contians the width if I ever add/delete columns, which just increases the chances of making my spreadsheet incorrect.&lt;/p&gt;
&lt;p&gt;Also, OFFSET is volatile, which introduces other considerations.&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9554755</link><pubDate>Sat, 18 Apr 2009 03:21:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9554755</guid><dc:creator>Kathy B</dc:creator><description>&lt;p&gt;Can someone expand on the &amp;quot;lastrow&amp;quot; formula above and also what is a UDF&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9554864</link><pubDate>Sat, 18 Apr 2009 08:28:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9554864</guid><dc:creator>wolfewa</dc:creator><description>&lt;p&gt;Sorry to say, but this is excel 101 and not something that warrants discussion. &amp;nbsp;sorry....but it's true. &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9556209</link><pubDate>Mon, 20 Apr 2009 07:43:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9556209</guid><dc:creator>Paul Haywood</dc:creator><description>&lt;p&gt;Would this solution work when the data itself is being pulled into Excel via ODBC?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9556947</link><pubDate>Mon, 20 Apr 2009 20:01:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9556947</guid><dc:creator>Joseph Chirilov</dc:creator><description>&lt;p&gt;Kathy: LASTROW is not a function that actually exists in Excel. Sam suggested it as a possible new feature. A UDF is a &amp;quot;user-defined function&amp;quot;. Basically the idea is Excel allows you to write your own funtions that can be called in spreadsheet formulas just like any other function. UDFs can be created in a number of ways, the most common of which is in VBA (Visual Basic for Applications). &amp;nbsp;Sam was saying he wrote a UDF called LASTROW which tells him where the bottom of the data is on a given sheet.&lt;/p&gt;
&lt;p&gt;wolfewa: it may not be an advanced topic but there are many Excel users out there who would benefit from this information. This blog site does not cater only to advanced users.&lt;/p&gt;
&lt;p&gt;Paul: Yes this solution should work in that scenario.&lt;/p&gt;
</description></item><item><title>re: A Robust Way To Reference Multiple Columns In a Table</title><link>http://blogs.msdn.com/excel/archive/2009/04/08/a-robust-way-to-reference-multiple-columns-in-a-table.aspx#9592308</link><pubDate>Thu, 07 May 2009 01:59:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9592308</guid><dc:creator>Salvius</dc:creator><description>&lt;p&gt;&amp;quot;I'd have to remember to update the cell that contians the width if I ever add/delete columns&amp;quot;&lt;/p&gt;
&lt;p&gt;But you can also enter a COUNT() or COUNTA() function, to calculate the width/height based on what's actually there. For example (and just in case there are any differences, I'm using Excel 2003): &lt;/p&gt;
&lt;p&gt;SUM(OFFSET($A$1,ROW()-1,3,1,COUNTA($1:$1)-3))&lt;/p&gt;
&lt;p&gt;This formula (pasted into column C in each row) will correctly calculate total square footage in your first sample table, and additional rooms can be added simply by adding a &amp;quot;SqFt-RoomX&amp;quot; header in the header row and inputting the numbers. I suppose there is also the caution that the columns must be contiguous...&lt;/p&gt;
&lt;p&gt;I use this trick all the time, usually by using the offset formula to define a named range, which can then be used in other formulas. It's great for things like dynamically resizing charts/graphs, which can use named ranges for data sources.&lt;/p&gt;
</description></item></channel></rss>