+ Reply to Thread
Results 1 to 19 of 19

Excel 2003 sorting lot of data, multiply sheets by date

  1. #1
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Excel 2003 sorting lot of data, multiply sheets by date

    I have to sort lot of expiry dates , by the oldest one form 6 workbooks.
    Problem is on the same code in one or more sheets i have multiple values, so i cant use value lookup.
    At the moment i link directly every cell, but if someone adds rows everything will go wrong.

    Example

    Workbook 1

    Code . amount . expiry date . days to expire . amout . expiry date . days to expire . amout . expiry date . days to expire
    391 . 10 . 25-05-14 . 31 . 50 . 26-05-14 . 32 . 100 . 28-05-14 . 34
    391 . 15 . 25-09-14 . 61 . 60 . 29-05-14 . 39 . 600 . 01-06-14 . . 72
    391 . 25 . 15-09-14 . 61 . 55 . 19-05-14 . 39 . 622 . 01-09-14 . 72
    392 . 20 . 01-08-14 . 31 . 70 . 30-05-14 . 38 . 650 . 02-06-14 . 55
    393 . 20 . 01-08-14 . 31 . 70 . 30-05-14 . 38 . 650 . 02-06-14 . 55

    Problem is in this example code 391, sometimes i have 7-8 rows of same code, and valuelookup cant help, also i need to match code
    if someone inserts rows i dont do it all again.
    Where I hawe one row, i can do value lookup to main workbook to sort all data for one code to colms like

    code amout exp days
    amout exp days
    amout exp days

    and then with pivot sort them by the worksheet and oldest date like :
    code
    workbook1
    amout exp days (oldest date from workbook 1 for that code)
    amout exp days (next oldest date)
    amout exp days
    amout exp days
    workbook2
    amout exp days(oldest date from workbook 2 for that code)
    amout exp days
    amout exp days

    I just entered few rows, but i have about 10-15 codes that i need to sort
    I can attach some tables if needed if you cant understand my problem.
    Maybe I should use some macros or something ??

  2. #2
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Ok, so this looks to complicated or not understanding so i put one example workbook to make it easier to understand.
    I made to do index and match, but i still got value just for first row like in vlookup !!
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Maybe with the code below.

    See the attached file (sheet Output)

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Thanks for quick reply !!

    I need to sort it horizontally like :
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja

    So i can merge all with pivot table.
    You can see it in my example sheet 2 (i need to sort like this)

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Try this code in a dummy of your sheet.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Sorry but I dont know how to inert this code.
    Tried witn alt + F11 and new module but no luck.
    dummy, noob however you want.

    Made it work ,now i need some time to test and see the result.

    Thank you !!!
    Last edited by jevtabg; 05-06-2014 at 05:39 PM.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date


  8. #8
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    When I use this code on original workbook I just get some small mount of data sorted (only 11 rows of data)
    How to spred this code on entire workbook ?

    Quote Originally Posted by oeldere View Post
    Try this code in a dummy of your sheet.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    In that case I suggest you use a macro to get all data on 1 sheet.

    After that you can run the macro above.

    Please Login or Register  to view this content.
    this row means it starts at row 85.

    that could be the reason you get only a small amount of data.

    there is no use to copy the code in your answers (just take the part, will also do).

  10. #10
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Here in your example in sheet1 you have 37 diferent rows of data, and output shows only 24, so something is missing.

    Maybe thats why on original workbook i dont get all data too.The biggest workbook has 210 rows.

    THANKS AGAIN !!!!

    Quote Originally Posted by oeldere View Post
    See the attached file.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    I have to take a look at it, but probably this will not be today or tomorrow.

    I respond back to you, after I take a look.

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    I took a look in my file, posted #7.

    There are 15 rows and i find them in the sheet output.

    Please explain where you find the differance.

    Please reply.

  13. #13
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Each row has five colms to be sorted, so in output sheet we need to have 75 rows and we have only 61.
    With data (non blanks) in output folder we have 24 rows and in sheet1 we have 37 fields of data .


    Thanks alot for help !!!

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Without seeing your file it is very difficult to tell.

    So maybe you can tell me, why my posted solution don't match your expectation.

    After that, it is possible to implement it in the "real" file.

  15. #15
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    You attached file in post 7 as you said.In that file we have "sheet1"" from which we sort data and there we have 15 rows.Each row has 15 colms, and we need to sort them 3 by 3.
    Colm D TP kolicina
    Colm E Datum isteka proizvoda
    Colm F preostalo dana trajanja

    And it has to look like this

    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja
    TP količina Datum isteka proizvoda Preostalo dana trajanja

    Entire workbook not just part of it !!!!!

    Check the sheet1 (field D86 709, field E86 28-Oct-14, field f86 175 ) all this doesnt exist in output folder, that means its not all sorted.

  16. #16
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    @jevtabg

    Indeed, there was a failure in the code.

    See the new code and try it on a dummy of your sheet.

    I added manualy the expected result, and this one came up with the expected result (for the first object).

    Please test it again, and please respond.

    Sorry for the unconviency.

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Now it works great !
    THANK YOU!!!

    Just I must change i=6 and all sorted perfect.
    I have 2 more questions.
    Do I have to rename every sheet to sheet1, or I can change sheet1 to curent sheet, so the sheet I am in runs the macro.
    How to insert modules in some my workbook ? When I insert code in my workbok, I dont have option to run macro (so i always run it from your sample).And how to rename module, it always has full name jevtabg(oeldere5)....

    Sent from Huawei P6

  18. #18
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Please Login or Register  to view this content.
    If you have differant sheets you want to run the macro, you better get all data on one sheet (which is named sheet1) and after that rund this macro.

    [CODEHow to insert modules in some my workbook ? When I insert code in my workbok, I dont have option to run macro (so i always run it from your sample).And how to rename module, it always has full name jevtabg(oeldere5)....
    ]Please Login or Register to view this content.[/CODE]

    A) Use a file which allow you to run a macro (VBA).

    Those files have the extension .xlsm

    You can save a file as an .xlsm accepted file.

    B) Then you can add this code in your file.

    ALT + F11

    Insert => module

    Then you can past the given code in your file.

    Close the window by clicking on the red cross in the right corner.

    Save the file as an .xlsm file.

    Then you can run the code from your file.

    Hope I explained well enough.

  19. #19
    Registered User
    Join Date
    04-23-2014
    Location
    Serbia
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Excel 2003 sorting lot of data, multiply sheets by date

    Clear and well !!!

    You are the man !!!

    Thanks again !!!



    Sent from Huawei P6

+ 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. Sorting date ranges in Excel 2003
    By jwbenford in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-01-2012, 12:58 PM
  2. [SOLVED] =Sum help add divide and multiply (Excel 2003)
    By Excelnoub in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2012, 12:41 PM
  3. [SOLVED] Excel 2003 Summing and then sorting data by date then size
    By cajodonn in forum Excel General
    Replies: 7
    Last Post: 06-25-2012, 12:53 PM
  4. Data Sorting 101 Excel 2003
    By bianson in forum Excel General
    Replies: 7
    Last Post: 12-16-2010, 07:16 PM
  5. Sorting of data in excel 2003
    By jonpdavies in forum Excel General
    Replies: 3
    Last Post: 11-23-2005, 11:30 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