Produce list of months/year from list

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hey all

Is there any formula or VB code that can look down the list of dates in column A and produce a dynamic list in oldest to newest order?

NDA.v6.xlsm
ABC
1DATE
201-Jan-20
303-Feb-20January 2020
409-Feb-20February 2020
520-Mar-20March 2020
623-Mar-20April 2020
704-Apr-20January 2021
809-Apr-20February 2021
905-Jan-21September 2021
1009-Feb-21February 2022
1111-Feb-21
1217-Sep-21
1303-Feb-22
Data (2)


The required result shown in column c
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about
+Fluff 1.xlsm
ABC
1DATE
201/01/2020Jan-20
303/02/2020Feb-20
409/02/2020Mar-20
520/03/2020Apr-20
623/03/2020Jan-21
704/04/2020Feb-21
809/04/2020Sep-21
905/01/2021Feb-22
1009/02/2021 
1111/02/2021 
1217/09/2021 
1303/02/2022 
14
Main
Cell Formulas
RangeFormula
C2:C13C2=IFERROR(AGGREGATE(15,6,$A$2:$A$100/($A$2:$A$100<>"")/(ISNA(MATCH(TEXT($A$2:$A$100,"mmyyyy"),TEXT(C$1:C1,"mmyyyy"),0))),1),"")
 
Upvote 0
Upvote 0
Solution
@Peter_SSs and @Fluff
Thanks both - works just great!

Is it also possible to change the formula so that I can change the data held into a Table, so that the formula will automatically pick up any dates added at a later stage?
FYI the Table will simply be called Data Table

Thanks again guys
 
Upvote 0
Yes you can do that like
+Fluff 1.xlsm
ABC
1DATE
201/01/2020
303/02/202001/01/2020
409/02/202001/02/2020
520/03/202001/03/2020
623/03/202001/04/2020
704/04/202001/01/2021
809/04/202001/02/2021
905/01/202101/09/2021
1009/02/202101/02/2022
1111/02/2021 
1217/09/2021 
1303/02/2022 
14
Master
Cell Formulas
RangeFormula
C3:C13C3=IFERROR(AGGREGATE(15,6,(Table2[DATE]-DAY(Table2[DATE])+1)/ISNA(MATCH(Table2[DATE]-DAY(Table2[DATE])+1,C$2:C2,0)),1),"")
 
Upvote 0
Yes you can do that like
+Fluff 1.xlsm
ABC
1DATE
201/01/2020
303/02/202001/01/2020
409/02/202001/02/2020
520/03/202001/03/2020
623/03/202001/04/2020
704/04/202001/01/2021
809/04/202001/02/2021
905/01/202101/09/2021
1009/02/202101/02/2022
1111/02/2021 
1217/09/2021 
1303/02/2022 
14
Master
Cell Formulas
RangeFormula
C3:C13C3=IFERROR(AGGREGATE(15,6,(Table2[DATE]-DAY(Table2[DATE])+1)/ISNA(MATCH(Table2[DATE]-DAY(Table2[DATE])+1,C$2:C2,0)),1),"")

OK, I tried the changed formula however the first date comes out as January 1900 and and then the second row shows (correctly) January 2020
 
Upvote 0
Do you have any blank cells in the table?
 
Upvote 0
Do you have any blank cells in the table?

I've extended the data rows and what I'm working with is shown as example below..(Column A holds many rows of dates which includes dates up to today - but not copied in this example as far too many rows)

NDA.v6.xlsm
ABCDEFGHI
1DATEMONTHYEARYEAR2QSALESDAY
201-Jan-20Jan2019-202020Q1Wed
303-Feb-20Feb2019-202020Q1140MonJanuary 1900
403-Jan-20Jan2019-202020Q1FriJanuary 2020
504-Jan-20Jan2019-202020Q170SatFebruary 2020
605-Jan-20Jan2019-202020Q170SunSeptember 2022
706-Jan-20Jan2019-202020Q1960Mon 
807-Jan-20Jan2019-202020Q12000Tue 
908-Jan-20Jan2019-202020Q1Wed 
1009-Jan-20Jan2019-202020Q170Thu 
1110-Sep-22Sep2022-232022Q3475Sat 
1211-Jan-20Jan2019-202020Q170Sat 
1312-Jan-20Jan2019-202020Q1140Sun 
Data (2)
Cell Formulas
RangeFormula
B2:B13B2=IF(ISBLANK(A2),"",TEXT(A2,"MMM"))
C2:C13C2=IF(ISBLANK(A2),"",YEAR(EOMONTH(A2,9))-1&"-"&RIGHT(YEAR(EOMONTH(A2,9)),2))
D2:D13D2=IF(ISBLANK(A2),"",YEAR(A2))
E2:E13E2=IF(ISBLANK(A2),"",VLOOKUP(B2,Workings!$A$4:$C$15,3,FALSE))
G2:G13G2=IF(ISBLANK(A2),"",TEXT(A2,"DDD"))
I3I3=IFERROR(AGGREGATE(15,6,(Data_Table3-DAY(Data_Table3)+1)/ISNA(MATCH(Data_Table3-DAY(Data_Table3)+1,I$2:I2,0)),1),"")
I4:I13I4=IFERROR(AGGREGATE(15,6,($A$2:$A$13-DAY(A$2:A$13)+1)/ISNA(MATCH($A$2:$A$13-DAY(A$2:A$13)+1,I$2:I3,0)),1),"")


There could be blanks in column F (Sales) , where no sales made that day - all other columns should have a value for each day
 
Upvote 0
What exactly is Data_Table3 ?
 
Upvote 0
=IFERROR(AGGREGATE(15,6,(Table2[DATE]-DAY(Table2[DATE])+1)/ISNA(MATCH(Table2[DATE]-DAY(Table2[DATE])+1,C$2:C2,0)),1),"")

I changed your formula with Table2 to match the table name for my data - which is Data_Table3
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,934
Members
449,094
Latest member
teemeren

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