Finding invoice month based on periodic dates

GarryFreeman

New Member
Joined
Apr 17, 2020
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hello, I am hoping this is easy for someone but I cannot get my head around it.

My customer works in periods that are not calendar months but I need to report / forecast them in my own business in the calendar months.
I have managed to total the value using sumif but I am looking for a formula that will just populate the month based on the date ranges.

Using the example below the first line should return the month July as it falls between the customers dates of 25/06 and 22/07, however the second would fall into August as all sales between 23/07 and 19/08 from the customer are reported in their August figures.

Is there a simple formula that I could use to quickly reference what sales are falling into what months when they send me their orders based on expected delivery date (in the future)
For this I could assume that the below starts (QTY) in cell A1

Thanks in advance

Garry

QtyDue DateInvoice MonthStartsEnds
5​
12/07/2021​
January01/01/202121/01/2021
29​
30/07/2021​
February22/01/202118/02/2021
26​
30/07/2021​
March19/02/202125/03/2021
10​
30/07/2021​
April26/03/202122/04/2021
13​
30/07/2021​
May23/04/202120/05/2021
11​
30/07/2021​
June21/05/202124/06/2021
32​
02/08/2021​
July25/06/202122/07/2021
12​
02/08/2021​
August23/07/202119/08/2021
14​
02/08/2021​
September20/08/202123/09/2021
250​
03/08/2021​
October24/09/202121/10/2021
300​
03/08/2021​
November22/10/202118/11/2021
20​
23/08/2021​
December19/11/202123/12/2021
249​
23/08/2021​
5​
23/08/2021​
4​
23/08/2021​
22​
08/11/2021​
308​
08/11/2021​
4​
08/11/2021​
2​
08/11/2021​
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this formula

=INDEX($F$2:$F$13,MATCH(B2,$E$2:$E$13,-1))

Note you will need a lookup table as in E1:F13 below sorted in descending date order.


Book2
ABCDEF
1QtyDue DateInvoice MonthEnd DateMonth
2512/07/2021July23/12/2021December
32930/07/2021August15/11/2021November
42602/08/2021August21/10/2021October
51003/08/2021August23/09/2021September
61323/08/2021September19/08/2021August
71108/11/2021November22/07/2021July
824/06/2021June
920/05/2021May
1022/04/2021April
1125/03/2021March
1218/02/2021February
1321/01/2021January
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=INDEX($F$2:$F$13,MATCH(B2,$E$2:$E$13,-1))
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHI
1QtyDue DateInvoice MonthStartsEnds
2512/07/2021JulyJanuary0January01/01/202121/01/2021
32930/07/2021AugustFebruary0February22/01/202118/02/2021
42630/07/2021AugustMarch0March19/02/202125/03/2021
51030/07/2021AugustApril0April26/03/202122/04/2021
61330/07/2021AugustMay0May23/04/202120/05/2021
71130/07/2021AugustJune0June21/05/202124/06/2021
83202/08/2021AugustJuly5July25/06/202122/07/2021
91202/08/2021AugustAugust697August23/07/202119/08/2021
101402/08/2021AugustSeptember278September20/08/202123/09/2021
1125003/08/2021AugustOctober0October24/09/202121/10/2021
1230003/08/2021AugustNovember336November22/10/202118/11/2021
132023/08/2021SeptemberDecember0December19/11/202123/12/2021
1424923/08/2021September
15523/08/2021September
16423/08/2021September
172208/11/2021November
1830808/11/2021November
19408/11/2021November
20208/11/2021November
21
Reports
Cell Formulas
RangeFormula
E2:E13E2=SUMIFS(A:A,B:B,">="&H2,B:B,"<="&I2)
C2:C20C2=XLOOKUP(B2,$H$2:$H$13,$G$2:$G$13,"",-1)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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