Changing position of the subtotal row name

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
451
Office Version
  1. 365
Platform
  1. Windows
Fluff very kindly helped me with the formula below, which I have adapted to another sheet in excel.
The formula

=IFERROR(LET(d,SORT(UNIQUE(CHOOSECOLS(FILTER('Data Analysis'!$G$12:$DG$1000,'Data Analysis'!$G$12:$G$1000<>""),5,6,1,2,95,96,97,98))),u,UNIQUE(INDEX(d,,2)),SORTBY(VSTACK(d,CHOOSE(SEQUENCE(,8),u,"","","",SUMIFS('Data Analysis'!CW:CW,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CX:CX,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CY:CY,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CZ:CZ,'Data Analysis'!L:L,u))),VSTACK(SEQUENCE(ROWS(d)),XMATCH(u,INDEX(d,,2),0,-1)))),"")

is in Cell B12 and produces the result below.
I would like to get the sub total row name (BAKERY) to appear in both cells B18 and C18, but I can't see in the formula how it gets into Cell B12 currently.
If you can help that would be greatly appreciated.

1704106673699.png
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about
Excel Formula:
=IFERROR(LET(d,SORT(UNIQUE(CHOOSECOLS(FILTER('Data Analysis'!$G$12:$DG$1000,'Data Analysis'!$G$12:$G$1000<>""),5,6,1,2,95,96,97,98))),u,UNIQUE(INDEX(d,,2)),SORTBY(VSTACK(d,CHOOSE(SEQUENCE(,8),u,u,"","",SUMIFS('Data Analysis'!CW:CW,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CX:CX,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CY:CY,'Data Analysis'!L:L,u),SUMIFS('Data Analysis'!CZ:CZ,'Data Analysis'!L:L,u))),VSTACK(SEQUENCE(ROWS(d)),XMATCH(u,INDEX(d,,2),0,-1)))),"")
 
Upvote 0
Solution
I just have a further question if that is okay.
Please let me know if I need to send in a separate enquiry.
In the Excel at the start of this enquiry you will see that Cell D18 is empty as part of the array, however in an additional column (J) I am summing the column J on the basis of exclude the sub total values if Cells in Column D are empty My formula is - =SUMIFS(J$12:J$1000,$D$12:$D$1000,"<>").
It seems to be ignoring the empty cells in Column D. Is that because Column D is part of the array and isn't really empty?
 
Upvote 0
I think I have cracked it.
I have used the formula below which works.
=SUM(IF($D$12:$D$1000<>"", J$12:J$1000, 0))
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,934
Messages
6,175,487
Members
452,647
Latest member
MatthewBiersay

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