Formula to break out days of month in week.

mseferog

New Member
Joined
Nov 8, 2005
Messages
5
Hi,
I have weekly data that is based on Monday as the beginning of the week then counting 7 days to Sunday. My problem is that some weeks cross two months as in the example below week 1/29/2018. How do I write a formula to pick the amounts in each of the two months (Jan, Feb) and then show me the values in each of the two months that were in that particular week?
See example below.

Start Date End Date Month Sales $s Sales $ Jan Sales $ Feb
1/1/2018 1/7/2018 01JAN18 $1,523
1/8/2018 1/14/2018 01JAN18 $1,452
1/15/2018 1/21/2018 01JAN18 $1,892
1/22/2018 1/28/2018 01JAN18 $1,502

1/29/2018 2/4/2018 02FEB18 $1,587 ?? ??

2/5/2018 2/11/2018 02FEB18 $1,458
2/12/2018 2/18/2018 02FEB18 $1,478
2/19/2018 2/25/2018 02FEB18 $1,399
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You could do something like this : =IF(MONTH(D6)=MONTH(C6),"Find Partial Amount", "Find Normal Amount")

D6= Your End Date
C6= Start date
"Find Partial" = How you would tell the partial month sales
"Find Normal Amount" = However your formula was getting the sales regularly.



Hi,
I have weekly data that is based on Monday as the beginning of the week then counting 7 days to Sunday. My problem is that some weeks cross two months as in the example below week 1/29/2018. How do I write a formula to pick the amounts in each of the two months (Jan, Feb) and then show me the values in each of the two months that were in that particular week?
See example below.

Start Date End Date Month Sales $s Sales $ Jan Sales $ Feb
1/1/2018 1/7/2018 01JAN18 $1,523
1/8/2018 1/14/2018 01JAN18 $1,452
1/15/2018 1/21/2018 01JAN18 $1,892
1/22/2018 1/28/2018 01JAN18 $1,502

1/29/2018 2/4/2018 02FEB18 $1,587 ?? ??

2/5/2018 2/11/2018 02FEB18 $1,458
2/12/2018 2/18/2018 02FEB18 $1,478
2/19/2018 2/25/2018 02FEB18 $1,399
 
Upvote 0
Hi,

Formula started getting a little tricky when accounting for growing Months into the year...
In my sample, Columns A and B are Real Date values, D1:G1 are Real Date values formatted mmm


Book1
ABCDEFG
1Start DateEnd DateMonth SalesJanFebMarApr
21/1/20181/7/2018$1,5231,523.00
31/8/20181/14/2018$1,4521,452.00
41/15/20181/21/2018$1,8921,892.00
51/22/20181/28/2018$1,5021,502.00
61/29/20182/4/2018$1,587529.001,058.00
72/5/20182/11/2018$1,4581,458.00
82/12/20182/18/2018$1,4781,478.00
92/19/20182/25/2018$1,3991,399.00
102/26/20183/4/2018$1,234411.33822.67
113/26/20184/1/2018$5,6784,731.67946.3333
Sheet9
Cell Formulas
RangeFormula
D2=IFERROR(IF(AND(MONTH($A2)=MONTH(D$1),MONTH($B2)=MONTH(D$1)),$C2,IF(AND(MONTH($A2)=MONTH(D$1),MONTH($B2)=MONTH(E$1)),$C2/($B2-$A2)*(EOMONTH($A2,0)-$A2),IF(AND(MONTH($A2)=MONTH(C$1),MONTH($B2)=MONTH(D$1)),$C2/($B2-$A2)*DAY($B2),""))),"")


Formula copied down and across for all months.
 
Upvote 0
@ mseferog:

What is your expected split for

1/29/2018 2/4/2018 02FEB18 $1,587 ?? ??
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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