Forum Discussion
Patrick002320
Jun 08, 2023Copper Contributor
How can I combine data from multiple columns & rows into one row/column
Hello everyone, I have never done this before and I am very new to excel but I have a table of data about monthly temperatures for each year. In the A column I have all the years from 1961-2023 a...
Patrick2788
Jun 08, 2023Silver Contributor
PQ is the best solution with a large data set.
Here's another way with a formula:
=REDUCE(
{"Year", "Month", "Val"},
year,
LAMBDA(a, v,
LET(
values, TOCOL(FILTER(data, year = v)),
VSTACK(a, HSTACK(EXPAND(v, 12, , v), TOCOL(months), TOCOL(values)))
)
)
)