Forum Discussion

swanjohnny83's avatar
swanjohnny83
Copper Contributor
Aug 04, 2023
Solved

sum a value that's spread over a number of years as a fraction

hello, I am trying to work out a formula to sum grants awarded to departments in the example the departments called 5g, gets a grant award for £187,441.84, start date is 01/04/2018 and the end date...
  • mtarler's avatar
    mtarler
    Aug 17, 2023

    swanjohnny83  Forget that earlier sheet.  Try this one with this formula:

     

    =$G2/($D2-$C2+1)*MAX(0,MIN($D2,DATE(K$1+1,8,1)-1)-MAX($C2,DATE(K$1,8,1))+1)

     

     It takes the value of the grant divided by the #days in the grant * (lesser of (grant end date or fiscal year end) - greater of (grant start or fiscal yr start) ) and returns 0 if that difference is negative.

    As opposed to using a LAMBDA this specifically uses 08-01 as the start of the fiscal year.