Pivot Tables and the OFFSET command

gbarclay2001

New Member
Joined
Mar 17, 2002
Messages
46
Hi all,

after looking at a web page Dave Hawley kindly directed me to after my last post (www.ozgrid.com/Excel/DynamicRanges.htm), I'm still unable to solve my problem.

I have a pivot table on which I need to use the OFFSET command to find the total(bottom) row of a column in the table. The amount of rows in the pivot table is changeable and that's why I can't set a static reference to it. Also, not all of the rows will contain data so I basically have to find the last cell containg a number in a column.

My last (poor) effort looks like this:

=OFFSET('By Value'!$C$5,0,0,,MATCH("*",'By Value'!$C:$C,0))

This is just giving me the value of C5 but the total (and last figure in the column) is cell C12.

Any ideas what I'm doing wrong?

Greg
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Don't use OFFSET. Use GETPIVOTDATA instead. For example, given the following PivotTable whose upper-leftmost cell is H1...<Table border><TR VALIGN="bottom" STYLE="vnd.ms-excel.numberformat:* General[semicolon][semicolon][semicolon]@* "><TD ALIGN="left"><FONT FACE="Courier">Sum of Field3</FONT></TD><TD ALIGN="left"><FONT FACE="Courier">Field2</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> </FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> </FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> </FONT></TD></TR><TR VALIGN="bottom" STYLE="vnd.ms-excel.numberformat:* General[semicolon][semicolon][semicolon]@* "><TD ALIGN="left"><FONT FACE="Courier">Field1</FONT></TD><TD ALIGN="left"><FONT FACE="Courier">Jan</FONT></TD><TD ALIGN="left"><FONT FACE="Courier">Feb</FONT></TD><TD ALIGN="left"><FONT FACE="Courier">Mar</FONT></TD><TD ALIGN="left"><FONT FACE="Courier">Grand Total</FONT></TD></TR><TR VALIGN="bottom" STYLE="vnd.ms-excel.numberformat:* General[semicolon][semicolon][semicolon]@* "><TD ALIGN="left"><FONT FACE="Courier">Apple</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 10</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 20</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 15</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 45</FONT></TD></TR><TR VALIGN="bottom" STYLE="vnd.ms-excel.numberformat:* General[semicolon][semicolon][semicolon]@* "><TD ALIGN="left"><FONT FACE="Courier">Banana</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 34</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> </FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 12</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 46</FONT></TD></TR><TR VALIGN="bottom" STYLE="vnd.ms-excel.numberformat:* General[semicolon][semicolon][semicolon]@* "><TD ALIGN="left"><FONT FACE="Courier">Grand Total</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 44</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 20</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 27</FONT></TD><TD ALIGN="right"><FONT FACE="Courier"> 91</FONT></TD></TR></Table>

...the formula, =GETPIVOTDATA(H1,"Grand Total"), will produce 91.

The formula, =GETPIVOTDATA(H1,"Mar"), will produce 27.

The formula, =GETPIVOTDATA(H1,"Apple"), will produce 45.
This message was edited by Mark W. on 2002-03-28 12:17
This message was edited by Mark W. on 2002-03-28 15:38
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top