Forum Discussion
DaButcher
Nov 10, 2024Occasional Reader
Trying to sort by dates entered in 2 different columns
So I have data in 8 different columns. 4 of those columns will have dates in them and as you can see from the image, the dates won't exactly match most of the time. So, I'm trying to get ALL of the data (dates and amounts) to be sorted in chronological order in columns I/J. Also, not all the columns will have data in it all the time, data starts on row 6 and can go up to row 600. Can this be done using a formula? Not sure if there's a macro out there that will do this
As variant
=LET( a, SORT(WRAPROWS(TOCOL(A6:H1000),2)), FILTER(a, CHOOSECOLS(a,1) ) )
- NikolinoDEGold Contributor
Here is an alternative approach using VBA.
Hope this will help you.
- LorenzoSilver Contributor
Provided you run Excel 365/Web (you didn't mentioned so assumed:
in I6:
=SORT( WRAPROWS( TOCOL( A6:H11, 1 ), 2 ), 1 )