Forum Discussion
Hervinder
Dec 09, 2018Copper Contributor
Split cost between between two dates
I have a spreadsheet where i'm putting a start date and end date in two columns, in the next column i have a total cost and then the months in the columns after What i am trying to achieve is if ...
Haytham Amairah
Dec 10, 2018Silver Contributor
Hi,
To do that, you need this thing:
=IF(AND(MONTH(F6)>=MONTH($A$7),MONTH(F6)<=MONTH($B$7)),
IF(MONTH(F6)=MONTH($A$7),DAY(EOMONTH($A$7,0))-DAY($A$7)+1,
IF(MONTH(F6)=MONTH($B$7),DAY(DAY($B$7)),DAY(EOMONTH(F6,0)))),0)
But please note that the remaining days in Oct is 22, not 20.
To make the solution easier, I've changed the month headers to the first date of each month but I changed the format to show only the month.
Hope that helps
vaibhavilnt
Oct 17, 2021Copper Contributor
This formula does not work when my start date it and end date are not in the same calendar year. for example my start date is 14 October 2021 and end date is is 4th July 2022.
Generally I use MSP for doing this task but currently to work in Excel. Is there a way?
Generally I use MSP for doing this task but currently to work in Excel. Is there a way?