+ Reply to Thread
Results 1 to 14 of 14

To Automatically Sort data based on date

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    To Automatically Sort data based on date

    Hi All,

    Could someone please help me to sort datas in a report based on Date criteria given in a column.

    Sample work sheet attached. Cells to be sorted from range (A19:J48) based on the date values given in column A.

    please note these datas are pulled out from other mutliple worksheets based on Emp.no criteria using index & match.

    Kindly suggest to fix this using formulas or by macros whichever is simple.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: To Automatically Sort data based on date

    FORUM_D7.xlsHI

    Please find attached. THis shows you how to get the date so the rest will be adjusting the INDEX functions column number for the rest
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: To Automatically Sort data based on date

    Do you understand the Sort function in Excel.

    Highlight the range A19:J48
    Click on Data--->Sort
    Make sure that the box for contains header rows is unchecked
    Click on Ascending
    Click on the sort/ok button.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: To Automatically Sort data based on date

    alan, i think that what he's after is retrieving the values based on the dates at the top of the other (non data) sheet.

    I THINK :o)

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: To Automatically Sort data based on date

    nathansav--you may be right, but often it is not clear in the request. We'll find out when the OP responds.

  6. #6
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To Automatically Sort data based on date

    Guys, i want this to be done automated. becoz these values are retrieved here in report format using index & match function. now i just want the output to be sorted date wise automatically.
    Last edited by divi123; 05-14-2014 at 03:22 AM.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: To Automatically Sort data based on date

    Not sure what else you want as your explanation is not exactly specific and my crystal ball is broken.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To Automatically Sort data based on date

    Alan, let me be even more clear.. See i'm retrieving the leave data in the attached format from two worksheets which has leave credit input in one and leaves availed input in another. Using Index & Match i'm able to get those values pertaining to the respective employee when his/her Emp.no is entered in the report sheet.

    And now my query,

    is to automatically sort the retrieved value based on dates.

    in simple, when an Emp.no is entered in the format attached it gives the values from mutiple worksheets as per the formulas. now those retrieved data should be sorted automatically.

    pls suggest.
    Attached Files Attached Files
    Last edited by divi123; 05-15-2014 at 01:11 AM.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: To Automatically Sort data based on date

    Since I have not presented you with what you are looking for, I clearly do not understand what you are asking. You have presented the same worksheet with the same explanation. This is often referred to as "Einsteins's Theory on Insanity." .ie. doing the same thing over and over again expecting different results. Since we are not of that ilk, I suggest you try presenting your explanation in a different manner with examples. I clearly don't understand what you want. Your file offers no clue except to sort the data which I have done but you want something else?

  10. #10
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To Automatically Sort data based on date

    I apologize for that. think the attached will give u a clear picture.

    Attached work book contains 3sheets

    'Leave availed' : will have list of leaves availed by employees
    'Leave Credit': will have list of leaves credited to each employees

    the these datas are retrieved for an individual employee in a specific format in 3rd work sheet named as 'Emp Leave Card'

    just by entering the Emp.no i'm able to get those values using INDEX & MATCH functions
    (plx check the formulas for better understanding)

    now i need ur help to sort the retrieved automatically based on dates. i.e whether its a leave credit or leave availed, the values retrieved to be automatically sorted.

    Also suggest if there's any changes to made with the existing formulas in order to make my requirement simple.

    Hope i'm clear atleast this time.
    Attached Files Attached Files
    Last edited by divi123; 05-16-2014 at 04:11 AM.

  11. #11
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: To Automatically Sort data based on date

    Please Login or Register  to view this content.
    Ben Van Johnson

  12. #12
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To Automatically Sort data based on date

    hi protonLeah,

    pls help hw to run ths code

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: To Automatically Sort data based on date

    Open your VBE, Alt + F11
    In the left window, select the sheet you are working in
    In the right window a blank screen will open.

    Copy Ben's code and paste it into the window on the right.

    Close and Save the VBE

  14. #14
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To Automatically Sort data based on date

    Done but thers no changes happening... pls help

    Suggest you to work on Sheet attached in post # 10.

    and note that i'm using 2003 version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how do I automatically move data from one page to another based on the date
    By tkincannon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2013, 05:33 PM
  2. [SOLVED] Automatically sort the data and ranking based on the sorted data
    By rakesh2806 in forum Excel General
    Replies: 6
    Last Post: 01-07-2013, 03:51 PM
  3. Sort data based on date
    By viuf81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2011, 07:24 AM
  4. sort data based on date and time priority
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2010, 02:55 PM
  5. Sort,Count & Sum data based on unique date
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2009, 06:57 AM

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