Day per month between 2 dates

Dcata

New Member
Joined
Apr 10, 2018
Messages
7
Hi everyone,

I was wondering if you could help.

Is there a formula I can put in cells D3-G4 that looks at the start and end dates in columns A & B, counts the number of days that used in the month (E2-G2) and then multiplies the number of days by the cost in column C?

If it helps, the value in D2 is currently 31/01/2020 but Formatted to "Mmm"

Thanks a lot

ABCDEFG
1Spend per monthSpend per monthSpend per monthSpend per month
2StartEndCost per DayJanFebMarApr
320/01/202004/02/20201516560
427/02/202007/04/20202040620140
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
It is more common to use the first day of the month formatted as mmm than the last day, but either can be made to work.
25.08.20.xlsm
ABCDEFG
1Spend per monthSpend per monthSpend per monthSpend per month
2StartEndCost per DayJanFebMarApr
320/01/202004/02/2020151656000
427/02/202007/04/202020040620140
Sheet22
Cell Formulas
RangeFormula
D3:G4D3=(MEDIAN(EOMONTH(D$2,0),$A3,$B3)-MEDIAN(EOMONTH(D$2,-1),$A3,$B3))*$C3
 
Upvote 0
@jasonb75 excellent utilization of the median function, I have encountered similar case before & had a much, much longer formula to get the same results. Thank you, I have learned something new today :)
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,853
Members
449,051
Latest member
excelquestion515

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