Dynamically Change Row Location with Formula

SeanKH19

New Member
Joined
Jul 27, 2022
Messages
4
Hello,

This one might be a bit of a stretch, but I thought I'd ask anyway. I have some columns and rows next to a pivot table that contain a lot of logic to do COUNTIFS on other sheets, based on values from the pivot table. All that is working great. The problem is that, on a row below these columns and rows, I have a SUM() formula to get the total for each column. I would like that SUM() row to move as the pivot table headers are collapsed.
1659709068044.png


I tried using an IF statement in all the rows and columns to the right of the pivot table that checks that cell's position relative to "Grand Total". So IF below "Grand Total" do the SUM(), but IF above do my other formula. The problem is that the IF FALSE part of the statement does SUM(E$7:E$11), which creates a circular reference. Can anyone think of a way to make that summation row move as the pivot table expands and shrinks that resolves the circular reference?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,
I think you want keep SUM formula if some rows remove or filtered. Check the SUBTOTAL function. It keeps result even rows deleted or filtered.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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