The top table has weeks sorted into columns, and a count of days allocated to the weeks. The below table lists out months and the formula in the bottom table extracts the days in each of the weeks. The issue arises where there is a part day allocated, as the formula ignores this- it only counts the full days. The difference column in the below table shows the variance which should be zero if the formula was perfect.
Here is the current formula:
=let(Λ,tocol(bycol({$B$1:$V$2;$B3:$V3},lambda(Σ,chooserows(sequence(days(index(Σ,2,),index(Σ,1,))+1,1,Σ,1),sequence(index(Σ,3,))))),1,1),
countif(index(eomonth(Λ,)),eomonth(A$17,)))
Any help would be really appreciated!
All the best
Matt
Here is the current formula:
=let(Λ,tocol(bycol({$B$1:$V$2;$B3:$V3},lambda(Σ,chooserows(sequence(days(index(Σ,2,),index(Σ,1,))+1,1,Σ,1),sequence(index(Σ,3,))))),1,1),
countif(index(eomonth(Λ,)),eomonth(A$17,)))
Any help would be really appreciated!
All the best
Matt