+ Reply to Thread
Results 1 to 5 of 5

sort an array by the dates in a different array

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    sort an array by the dates in a different array

    Hello, I have 5 data series in one sheet that contains the data (A) that would like to sort and their corresponding dates are in a different sheet (B). I would like to sort the data in A by a unique date series starting from the earliest date in B and ending with the most recent date in B. My aim is to get an array where the first column contains all the dates and 5 columns of data where the data not available for a specific date will be NA.

    I have used the date column containing the earliest date but can't figure out how to sort then the data by its corresponding date column and then create the array.

    Thanks for your help.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sort an array by the dates in a different array

    Hi,

    I don't fully understand what you expect to see. Please add some manually calculated results in sheet 3 and explain how you arrive at them.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: sort an array by the dates in a different array

    Hi Richard, see attached. First I have taken for instance the second column of sheet two that contains the larger date series and pasted in the 1st column of sheet3. Then, columns B,C and D don't need to be sorted because they all are in the same date range. Column A 1st data corresponds to July 2001, 23th and therefore is pasted in sheet3 from row 231 on. Column E data is pasted from row 144 onwards matching its corresponding first date (November 1999, 22th)
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sort an array by the dates in a different array

    Hi,

    In B2 on Sheet 3 and copied down and across to column F

    =INDEX(Hoja1!A:A,MATCH($A2,Hoja2!A:A,FALSE),1)

    Hope that helps

    Regards

  5. #5
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: sort an array by the dates in a different array

    Thanks for your solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1