I’m working on an Excel workbook that has data spread across multiple sheets (e.g., "Coal", "Steel", "Turbofuel", "Computer"). Each sheet contains arrays of data related to different resources (like Coal, Water, Iron, etc.), with associated values such as Produced, Used, and Excess. I've successfully gathered all the unique resource names into a single column on a summary sheet using formulas, but I'm encountering an issue when trying to sum the associated values across the sheets. The problem arises because the arrays on each sheet are not the same size, and some resources are repeated across sheets. This results in spill errors when I try to combine them into one summary column. I need to sum the values for each unique resource across the different sheets, but the varying array sizes and spread-out data are making this difficult to achieve. Any advice on how to effectively sum these values into a single array would be greatly appreciated! I would also prefer to do this with out VBA as I have had issues with it in the past.
My formula for gathering unique text data in the summary page:UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>", TRUE, $AA$4#, $AB$4#, $AC$4#, $AD$4#)&"</s></t>", "//s"))
and AA through AD is found:
LAMBDA(c, FILTER( INDIRECT(c & ":" & c ), (INDIRECT(c & ":" & c ) <> "") * (ROW(INDIRECT(c & ":" & c)) > 2) ))(CHAR(AA$3 + 64))
where row three is the column number of the found data. I don't like this approach and would rather use a single formula to find all the unique data.
I get each column of data in my summary page by:
LAMBDA(x,c, IFERROR( FILTER(INDIRECT("'" & x & "'!$" & c &":$" & c), INDIRECT("'"&x&"'!$S:$S") = TRUE), NA() ))(INDIRECT(ADDRESS(1, COLUMN())), INDIRECT(ADDRESS(2, COLUMN())))
My summary page:image of summary page