Forum Discussion

DaButcher's avatar
DaButcher
Occasional Reader
Nov 10, 2024

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) ) )

     

    • NikolinoDE's avatar
      NikolinoDE
      Gold Contributor

      Here is an alternative approach using VBA.

      Hope this will help you.

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Provided you run Excel 365/Web (you didn't mentioned so assumed:

    in I6:

    =SORT( WRAPROWS( TOCOL( A6:H11, 1 ), 2 ), 1 )

     

Resources