Pivot table question

Davebro

Board Regular
Joined
Feb 22, 2018
Messages
135
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
I have a pivotable table which Columns A,B,C which are from the data set, B2 and B3 are the highest number from Columns B & C. Column D has the calculation =(B5-B$2)-(C5-C$2) and column E ranks them, In H5 I am using =CHOOSECOLS(SORT(FILTER(A5:G13,E5:E13<=3),5,TRUE),5,1) formula (which works well and was given to me by a forum contributor), however when I use the slicer to move to another time and the length of the columns move from say 13 to 6 or 13 to 16. is there anyway that the calculations can adjust to the altered column length.
 

Attachments

  • Pivot.jpg
    Pivot.jpg
    176.7 KB · Views: 8

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi

Please check whether finding the last row using ROW&OFFSET, and then using that in INDIRECT helps

Finding last row (13 in the image pasted) in cell H1 =ROW(OFFSET(A4,COUNTA(A6:A10),0))-1

Please use indirect as below (replace G13 with INDIRECT("G"&H1), E13 with INDIRECT("E"&H1) etc)

=CHOOSECOLS(SORT(FILTER(A5:INDIRECT("G"&H1),E5:INDIRECT("E"&H1)<=3),5,TRUE),5,1)
 
Upvote 0
Hi

Please check whether finding the last row using ROW&OFFSET, and then using that in INDIRECT helps

Finding last row (13 in the image pasted) in cell H1 =ROW(OFFSET(A4,COUNTA(A6:A10),0))-1

Please use indirect as below (replace G13 with INDIRECT("G"&H1), E13 with INDIRECT("E"&H1) etc)

=CHOOSECOLS(SORT(FILTER(A5:INDIRECT("G"&H1),E5:INDIRECT("E"&H1)<=3),5,TRUE),5,1)
Wow, thank you, much appreciated.
 
Upvote 0

Forum statistics

Threads
1,217,915
Messages
6,139,375
Members
450,200
Latest member
lucabaz

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