I need some fresh pair of eyes to look at the following Excel formula. I’ve got the following formula, where I cannot seem to make it spill down dynamically. The formula currently spills to the right correctly. If I change B5 and C5 to B5# and C5#, the formula does spill down (and to the right) correctly, but the values are incorrect. Can someone help me? Below is the formula. Note that B5# and C5# spill down the same exact number of rows with 1 column each and D$1# and D$2 spill to the right the same exact number of columns with 1 row each. I would appreciate your help. Thanks.
=LET(
deviceInstall, B5,
deviceRemoval, C5,
tcoStartDate, 'Deal Information'!B$6,
tcoEndDate, 'Deal Information'!B$7,
tcoStart, D$1#,
tcoEnd, D$2#,
installMonthsFrac, MAP(tcoEnd, LAMBDA(end,
TRUNC(YEARFRAC(deviceInstall, end) * 12) +
IF((DAYS(EOMONTH(deviceInstall, 0), deviceInstall) + 1) / DAY(EOMONTH(deviceInstall, 0)) = 1,
0,
(DAYS(EOMONTH(deviceInstall, 0), deviceInstall) + 1) / DAY(EOMONTH(deviceInstall, 0))
)
)),
removalMonthsFrac, MAP(tcoStart, LAMBDA(start,
TRUNC(YEARFRAC(start, MIN(deviceRemoval, tcoEndDate)) * 12) +
IF(DAY(MIN(deviceRemoval, tcoEndDate) - 1) / DAY(EOMONTH(MIN(deviceRemoval, tcoEndDate), 0))=1,
0,
DAY(MIN(deviceRemoval, tcoEndDate) - 1) / DAY(EOMONTH(MIN(deviceRemoval, tcoEndDate), 0))
))),
IF(
deviceInstall >= tcoStart,
IF(deviceInstall < tcoEnd,
installMonthsFrac,
0
),
IF(
deviceRemoval < tcoEnd,
IF(deviceRemoval >= tcoStart,
removalMonthsFrac,
0
),
IF(removalMonthsFrac < 12,
removalMonthsFrac,
12
)
)
)
)