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 ) ))
)
Here is a mock table as was requested by one of the users. The above formula is in cell D5 and it should spill to the right and down.
B | C | D | E | F | G | H | I | |
---|---|---|---|---|---|---|---|---|
1 | 01-Jul-24 | 01-Jul-25 | 01-Jul-26 | 01-Jul-27 | 01-Jul-28 | 01-Jul-29 | ||
2 | 01-Jul-25 | 01-Jul-26 | 01-Jul-27 | 01-Jul-28 | 01-Jul-29 | 01-Jan-30 | ||
5 | 01-Nov-24 | 29-Oct-29 | 8.000 | 12.000 | 12.000 | 12.000 | 12.000 | 3.903 |
6 | 01-Oct-24 | 29-Oct-29 | 9.000 | 12.000 | 12.000 | 12.000 | 12.000 | 3.903 |
7 | 01-Oct-24 | 29-Oct-29 | 9.000 | 12.000 | 12.000 | 12.000 | 12.000 | 3.903 |