I have two data sets for a set of properties across two different years:
Here is a link to the data sets if helpful: Link to Example Datasets
I want to make a pivot table (or any kind of table that works) that compares the different Type fields across the two years for each property. It would look something like this:
I know I could so something like rename each column PropertyA Year 1, Property B Year 1, etc, but I would prefer not to do this because I’m using the tables elsewhere where this naming convention is not desirable.
How can I achieve the desired table from these two data sets?
Thank you!
Kim
Here’s a generalized approach which you may adapt accordingly:
=reduce(tocol(,1),sequence(rows(YEAR1)),lambda(a,c,ifna(vstack(a,let(Δ,+chooserows(YEAR1,c),Σ,hstack(Δ,tocol(B3:D3),tocol(chooserows(B4:D8,c)),tocol(chooserows(B13:D17,c))),
vstack(Σ,hstack(Δ&" Total",,bycol(choosecols(Σ,3,4),lambda(Λ,sum(Λ))))))))))
- the formula strictly assumes that both the tables have equal number of rows & same row wise order of
Type
for year wise comparison of tables!