trying to split grant award across academic years

jswan83

New Member
Joined
Nov 19, 2024
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi,
i am trying to come up with a formula to split project grants across, multiple years.
The academic year starts in the 01/08/2016 and finished the 31/07/2017
one example column A2 has a start date of 01/08/2017 and finishes on the 30/11/2020 in column B2.
the total in C2 is £587,009. in columns d2-G2 has the academic years 2017/2018-2020/2021.

The expected answers have been entered in columns D:H.

I have taken a screenshot, if necessary I can upload the spreadsheet, however I'll need to wait until I am home, as my work computer doesn't allow me to download the add in for XL2BB.

Thanks

Johnny
 

Attachments

  • example1.PNG
    example1.PNG
    44.4 KB · Views: 12

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hello, maybe something like:

Excel Formula:
=(MAX(MIN(DATE(--RIGHT(D$1,4),7,31),$B2)-MAX(DATE(--LEFT(D$1,4),8,1),$A2)+1,0))/($B2-$A2+1)*$C2

But this takes into account that some years have 366 days which is not what you are looking for?
 
Upvote 0
As you are using Microsoft 365 you can also use new spill formulas, so in D2 write:
Excel Formula:
=LET(SoAY,DATE(--LEFT(D$1:L$1,4),8,1),EoAY,DATE(--RIGHT(D$1:L$1,4),7,31),DaysStep1,IF(B2<EoAY,B2,EoAY)-IF(A2>SoAY,A2,SoAY)+1,PrDays,IF(DaysStep1>0,DaysStep1,0),PrDays/SUM(PrDays)*C2)

This one is "leap year aware" and in leap years a bit more money is assigned.

If you want to have just in parts of years (thus second example will have 3 "inner" years with exactly 25 000 (BTW - the values on screenshot are obviously wrong for second grant) you may use in D2:
Excel Formula:
=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2<EoAY,B2,EoAY)-IF(A2>SoAY,A2,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/SUM(PrPart)*C2)

And copy the formula down.

The "mechanism behind" is anyway the same as in @hagia_sofia "non-spill" formula.

The formulas are longer, because MIN and MAX formulas try to use array argument as a whole and produce single value, not an array at output :-(.
 
Last edited:
Upvote 0
Hello, maybe something like:

Excel Formula:
=(MAX(MIN(DATE(--RIGHT(D$1,4),7,31),$B2)-MAX(DATE(--LEFT(D$1,4),8,1),$A2)+1,0))/($B2-$A2+1)*$C2

But this takes into account that some years have 366 days which is not what you are looking for?
Hi,
This works, thanks. so this formula will be aware of leap years. as I've worked out 01/08/20?? to 31/07/20?? is roughly 364 days. I didn't consider the leap years.
 
Upvote 0
As you are using Microsoft 365 you can also use new spill formulas, so in D2 write:
Excel Formula:
=LET(SoAY,DATE(--LEFT(D$1:L$1,4),8,1),EoAY,DATE(--RIGHT(D$1:L$1,4),7,31),DaysStep1,IF(B2<EoAY,B2,EoAY)-IF(A2>SoAY,A2,SoAY)+1,PrDays,IF(DaysStep1>0,DaysStep1,0),PrDays/SUM(PrDays)*C2)

This one is "leap year aware" and in leap years a bit more money is assigned.

If you want to have just in parts of years (thus second example will have 3 "inner" years with exactly 25 000 (BTW - the values on screenshot are obviously wrong for second grant) you may use in D2:
Excel Formula:
=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2<EoAY,B2,EoAY)-IF(A2>SoAY,A2,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/SUM(PrPart)*C2)

And copy the formula down.

The "mechanism behind" is anyway the same as in @hagia_sofia "non-spill" formula.

The formulas are longer, because MIN and MAX formulas try to use array argument as a whole and produce single value, not an array at output :-(.
Hi Kaper,
thanks, It appears, I have a lot still to learn about excel, i don't really know the spill formula, do I just drag the formula down rows in order for it fill in the rows?
 
Upvote 0
01/08/20?? to 31/07/20?? is either 365 or 366 days. if you calculate period length in days you take endday-startday+1
Easy way to understand this +1 is if you imagine 1 day project . If you jyst take endday-startday you will have 0. so +1 is needed

A spill formula - it spills automatically (in this case - to the right, the same number of columns ans nymber of AY header in row1 ).
so horizontal filling of table is taken by formula, but it has to be copied to next rows (cells D3, D4, ...) to have also vertical fill.
 
Upvote 0
01/08/20?? to 31/07/20?? is either 365 or 366 days. if you calculate period length in days you take endday-startday+1
Easy way to understand this +1 is if you imagine 1 day project . If you jyst take endday-startday you will have 0. so +1 is needed

A spill formula - it spills automatically (in this case - to the right, the same number of columns ans nymber of AY header in row1 ).
so horizontal filling of table is taken by formula, but it has to be copied to next rows (cells D3, D4, ...) to have also vertical fill.
Hi Kaper,
Thanks for clarifying, I've just tried this formula, however, in the cells where there's zeros, it just has the the #spill! error, can I add to it, to display £0 instead of the #spill! error. added an image.
 

Attachments

  • example2.PNG
    example2.PNG
    35.5 KB · Views: 2
Upvote 0
delete any zeros or old values from D2: before inserting formula. And insert it only in D2 then copy down only (no right copying even if xlBB shows D2:L4 the formula is copied only to D2:D4 and is spilled to the right)

Zeszyt1
ABCDEFGHIJKL
1startendamount2016/20172017/20182018/20192019/20202020/20212021/20222022/20232023/20242024/2025
201.08.201730.11.2020587 009,00 GBP0,00 GBP175 909,92 GBP175 909,92 GBP176 391,87 GBP58 797,29 GBP0,00 GBP0,00 GBP0,00 GBP0,00 GBP
301.04.201731.03.2021100 000,00 GBP8 350,44 GBP24 982,89 GBP24 982,89 GBP25 051,33 GBP16 632,44 GBP0,00 GBP0,00 GBP0,00 GBP0,00 GBP
401.08.201730.11.2020239 944,00 GBP0,00 GBP71 904,40 GBP71 904,40 GBP72 101,40 GBP24 033,80 GBP0,00 GBP0,00 GBP0,00 GBP0,00 GBP
Arkusz1
Cell Formulas
RangeFormula
D2:L4D2=LET(SoAY,DATE(--LEFT(D$1:L$1,4),8,1),EoAY,DATE(--RIGHT(D$1:L$1,4),7,31),DaysStep1,IF(B2<EoAY,B2,EoAY)-IF(A2>SoAY,A2,SoAY)+1,PrDays,IF(DaysStep1>0,DaysStep1,0),PrDays/SUM(PrDays)*C2)
Dynamic array formulas.
 
Upvote 0
Just one more step - it is really one formula in one cell (D2) spilled right and down. so empty all D2:L4 and insert in d2 (of course you will have yo apply currency formatting to all output cells) :

Excel Formula:
=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2:B4<EoAY,B2:B4,EoAY)-IF(A2:A4>SoAY,A2:A4,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/BYROW(PrPart,SUM)*C2:C4)

Example.xlsx
ABCDEFGHIJKL
1startendamount2016/20172017/20182018/20192019/20202020/20212021/20222022/20232023/20242024/2025
201.08.201730.11.20205870090176054,5176054,5176054,558845,60000
301.04.201731.03.20211000008356,1643825000250002500016643,840000
401.08.201730.11.2020239944071963,4871963,4871963,4824053,550000
Arkusz1
Cell Formulas
RangeFormula
D2:L4D2=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2:B4<EoAY,B2:B4,EoAY)-IF(A2:A4>SoAY,A2:A4,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/BYROW(PrPart,SUM)*C2:C4)
Dynamic array formulas.
 
Upvote 0
Just one more step - it is really one formula in one cell (D2) spilled right and down. so empty all D2:L4 and insert in d2 (of course you will have yo apply currency formatting to all output cells) :

Excel Formula:
=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2:B4<EoAY,B2:B4,EoAY)-IF(A2:A4>SoAY,A2:A4,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/BYROW(PrPart,SUM)*C2:C4)

Example.xlsx
ABCDEFGHIJKL
1startendamount2016/20172017/20182018/20192019/20202020/20212021/20222022/20232023/20242024/2025
201.08.201730.11.20205870090176054,5176054,5176054,558845,60000
301.04.201731.03.20211000008356,1643825000250002500016643,840000
401.08.201730.11.2020239944071963,4871963,4871963,4824053,550000
Arkusz1
Cell Formulas
RangeFormula
D2:L4D2=LET(AY,--LEFT(D$1:L$1,4),SoAY,DATE(AY,8,1),EoAY,DATE(AY+1,7,31),DaysStep1,IF(B2:B4<EoAY,B2:B4,EoAY)-IF(A2:A4>SoAY,A2:A4,SoAY)+1,PrPart,IF(DaysStep1>0,DaysStep1,0)/(DATE(AY+1,12,31)-DATE(AY,12,31)),PrPart/BYROW(PrPart,SUM)*C2:C4)
Dynamic array formulas.
Hi Kaper,
I tried the newer formula, however I'm getting the #Name! error, the previous formula works, after removing all the figures. if there a difference between formulas?
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,099
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top