Forum Discussion
HARS365
Jan 28, 2025Copper Contributor
Put a MONTH function value in a SUM function
Hello, I have the following SUM function in a sheet named Variance. It sums cells B11 to B22 from a sheet named 2025 Budget. The 2025 Budget cells are January (B11) to December (B22) budget value...
- Jan 29, 2025
=SUM(INDIRECT("'2025 Budget'!B11:B"&MONTH('2025 Budget'!B6)+10))
or
=SUM(OFFSET('2025 Budget'!B11, 0, 0, MONTH('2025 Budget'!B6), 1))
m_tarler
Jan 29, 2025Silver Contributor
I think Hans' second formula is missing the MONTH:
=SUM(OFFSET('2025 Budget'!B11, 0, 0, MONTH('2025 Budget'!B6), 1))
another alternative is:
=SUM( B11:INDEX(B11:B22, MONTH(B6)) )
PeterBartholomew1
Jan 29, 2025Silver Contributor
You guys are doing so much better than I! You seem to have understood the problem for a start. I toyed with ideas such as
= LET(
months, DATEDIF(startdate, targetdate, "m"),
SUM(TAKE(amounts, months))
)but I was pretty clueless when it came to knowing whether it was even the right problem.