Forum Discussion
djs72
May 09, 2023Copper Contributor
Script to count and total varying window sizes
 Hi.     I'm working on a spreadsheet and I want to create a script where it will look at the plan name (Column A), then take the window sizes from Columns B and C and the Optional "z" and total them ...
OliverScheurich
May 09, 2023Gold Contributor
An alternative could be Power Query. In the attached file you can add data to the blue dynamic table. Then you can click in any cell of the green table and right-click with the mouse and select refresh to update the green result table.
djs72
May 09, 2023Copper Contributor
Thanks Quadruple! This looks interesting and I'll give it a shot as well
- OliverScheurichMay 10, 2023Gold Contributor
=LET(range,A2:D17,rangeunique,UNIQUE(IF(range="","",range)),HSTACK(rangeunique,MAP(CHOOSECOLS(rangeunique,1),CHOOSECOLS(rangeunique,2),CHOOSECOLS(rangeunique,3),CHOOSECOLS(rangeunique,4),LAMBDA(colF,colG,colH,colI,SUMPRODUCT((CHOOSECOLS(range,1)=colF)*(CHOOSECOLS(range,2)=colG)*(CHOOSECOLS(range,3)=colH)*(CHOOSECOLS(range,4)=colI))))))With Office 365 or Excel for the web you can apply this formula.