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 Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Yes and No, It has correctly added the date as required into I4:I14 (getting the data from my Data_Table3) but as you can see it places January 1900 into cell I3 (being the fisr cell the formula is pasted)

There are blank cells though column F, but all other columns will normally be populated with some value



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"))
I3:I13I3=IFERROR(AGGREGATE(15,6,(Data_Table3[DATE]-DAY(Data_Table3[DATE])+1)/ISNA(MATCH(Data_Table3[DATE]-DAY(Data_Table3[DATE])+1,I$2:I2,0)),1),"")
 
Upvote 0
The only way I can get a date of Jan 1900 is if there is a blank cell in the date column. Does the table extend below the last row with data?
 
Upvote 0
so I've copied the table that shows whats further down....

Cell Formulas
RangeFormula
B12:B18B12=IF(ISBLANK(A12),"",TEXT(A12,"MMM"))
C12:C18C12=IF(ISBLANK(A12),"",YEAR(EOMONTH(A12,9))-1&"-"&RIGHT(YEAR(EOMONTH(A12,9)),2))
D12:D18D12=IF(ISBLANK(A12),"",YEAR(A12))
E12:E18E12=IF(ISBLANK(A12),"",VLOOKUP(B12,Workings!$A$4:$C$15,3,FALSE))
I12:I13I12=IFERROR(AGGREGATE(15,6,(Data_Table3[DATE]-DAY(Data_Table3[DATE])+1)/ISNA(MATCH(Data_Table3[DATE]-DAY(Data_Table3[DATE])+1,I$2:I11,0)),1),"")
G12:G18G12=IF(ISBLANK(A12),"",TEXT(A12,"DDD"))


As you can see Columns B:D and G all have formula populated whereas Column A is completly blank
So, yes, the DATE column (A) does have blank cells

Sorry for any confusion, and if this is too much of a pain, I can just live with the original formula
 
Upvote 0
The whole point of having a table is that when you add data formulae carry down & therefore you should not have blank rows in the table. If you delete the blank rows, then the formula will work.
 
Upvote 0
The whole point of having a table is that when you add data formulae carry down & therefore you should not have blank rows in the table. If you delete the blank rows, then the formula will work.
OK, got it

Realy appreciate your help with this = many thanks
 
Upvote 0
Since it seems you have converted to a table and removed the blank rows, you could reconsider the formulas inside the table to use the table nomenclature as well as eliminate the check for blanks.
Plus I have suggested a couple of other minor changes.


redspanna.xlsm
ABCDEFG
1DATEMONTHYEARYEAR2QSALESDAY
201-Jan-20Jan2019-202020Q1Wed
303-Feb-20Feb2019-202020Q1140Mon
403-Mar-21Mar2020-212021Q1Wed
505-Sep-21Sep2021-222021Q370Sun
604-Dec-20Dec2020-212020Q470Fri
711-Jun-22Jun2022-232022Q2960Sat
813-Aug-21Aug2021-222021Q32000Fri
901-Jan-20Jan2019-202020Q1Wed
1003-Jan-22Jan2021-222022Q170Mon
1102-Sep-22Sep2022-232022Q3475Fri
1219-May-20May2020-212020Q270Tue
1325-Feb-21Feb2020-212021Q1140Thu
Sheet2
Cell Formulas
RangeFormula
B2:B13B2=TEXT([@DATE],"mmm")
C2:C13C2=YEAR(EOMONTH([@DATE],-3))&TEXT(EOMONTH([@DATE],9),"-yy")
D2:D13D2=YEAR([@DATE])
E2:E13E2="Q"&INT((MONTH([@DATE])-1)/3)+1
G2:G13G2=TEXT([@DATE],"ddd")
 
Upvote 0
I did not follow this thread originally and I am not entirely sure where it stands now, but I wanted to note that since the OP is using XL365, the following formula will produce a spilled list like the OP said he wanted originally...
Excel Formula:
=TEXT(SORT(0+UNIQUE(TEXT(A2:A13,"mmmm yyyy"))),"mmmm yyyy")
 
Upvote 0
.. but I wanted to note that since the OP is using XL365, the following formula will produce a spilled list ..
Good point Rick. A couple of comments though ..

In the OP's original mini-sheet the values in column C are actually dates, (1st of each relevant month) so the mmmm yyyy formatting must be from the cell formatting. Therefore it should only require this from the formula I believe

Excel Formula:
=SORT(0+UNIQUE(TEXT(A2:A13,"mmmyy")))

Further, since the request was for a "dynamic list" and a table structure is now being used, this should give an automatically expanding/contracting list as the table changes.
(As earlier, still assuming no blanks in the DATE column of the table)

Excel Formula:
=SORT(0+UNIQUE(TEXT(Data_Table3[DATE],"mmmyy")))
 
Upvote 0

Forum statistics

Threads
1,215,324
Messages
6,124,250
Members
449,149
Latest member
mwdbActuary

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