+ Reply to Thread
Results 1 to 24 of 24

return latest date for a order number that pops up frequently

  1. #1
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    return latest date for a order number that pops up frequently

    So the problem i'm facing is that a I have order 001 (for example) that has been worked on for a span of 2 or more months. This means the order 001 pops up 2 or more times with the same quantity in month 1,2 and so on. The quantity eventually gets booked off at the last month its been worked on (when its finished obvly).

    Normally i would just use the average to calculate the quantity, but I also need it to return the last month as well, because that is the month it will get booked off.

    The file that is added will probably tell you more about the problem and the result I'm looking for. The hardest part is that i needs to show the last month that the order has been worked on!



    If there are any other questions feel free to ask them and I hope it is clear what I'm looking for.


    Thanks in advance.


    Kind regards,
    Rikkie54321
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    Try this in K2:

    =LOOKUP(2,1/($A$2:$A$20=$J2),B$2:B$20)

    Drag to the right and down.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,348

    Re: return latest date for a order number that pops up frequently

    Welcome to the forum.

    The biggest problem you are going to face here is that the data in the right-hand column is text, not dates. Are you OK for this to be changed so that calculations can be made?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    If you want a formula for column J as well, you can use this in J2:

    =INDEX(A$2:A$20,MATCH(0,COUNTIF(J$1:J1,A$2:A$20),0)) Ctrl Shift Enter

    Drag it down column K.

  5. #5
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Hi Falcon,


    Thanks for your quick reply first of all. This seems to work in both files.

    I don't want to have to put in the unique order numbers however, is there a solution to automate this process as well? Or atleast put in the unique order numbers with a formula. The data in the workbook will be retrieved from another file via a formula as well. All I want to do is put in the data in the other workbook.

    Hope you understand what i mean.

    Hope to hear from you and thanks again.

  6. #6
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    You already posted it, haha. Ok let me try that. I'll come back to you!

  7. #7
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    It seems, that when the latest date is on the bottom it works fine but when the latest date is on top it goes wrong. so when you turn around some of the months in the file it shows november instead of december for instance

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    Right. This was addressed in post #3.

  9. #9
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Is there something I can do, so this won't be the case? change the months into "10-2019" instead of "2019 sep" for instance?

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    Change the dates in column C to actual dates (you can then format these to show however you'd like).
    You can use this formula in D2 to do so:

    =(RIGHT(C2,3)&" 1, "&LEFT(C2,4))+0
    Drag down column D then copy/paste values into column C.

    Then, once you have actual dates in column C, you can use these:

    L2 =AGGREGATE(14,6,(A$2:A$20=$J2)*(C$2:C$20),1)

    K2 =LOOKUP(2,1/((A$2:A$20=J2)*(C$2:C$20=L2)),B$2:B$20)
    Last edited by 63falcondude; 07-12-2019 at 10:21 AM.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,348

    Re: return latest date for a order number that pops up frequently

    Quote Originally Posted by 63falcondude View Post
    Right. This was addressed in post #3.
    Yes, it was, and it was completely ignored, it seems, by the OP.

  12. #12
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Could you send me the workbook, doesn't seem to work for me. The month shows a #num! error This should look at the D cells right? if I do that i comes up with weird numbers.


    See workbook
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Quote Originally Posted by AliGW View Post
    Yes, it was, and it was completely ignored, it seems, by the OP.
    I'm truely sorry, guess i misunderstood.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,348

    Re: return latest date for a order number that pops up frequently

    It was pretty crucial.

    Anyway, you have your answer now.

  15. #15
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    Those aren't the formulas that I shared in post #10.

    See attachment.
    Attached Files Attached Files

  16. #16
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: return latest date for a order number that pops up frequently

    The formula that I used in column D was just a quick way to get the dates into column C.

    I copied the formulas in column D and then pasted values into column C. Then removed what was in column D.

    Now that the dates are actual dates, you can format them to show however you'd like.

  17. #17
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Still facing a problem in my original file, however I won't be able to respond untill monday. To be continued.

  18. #18
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Hello guys,

    The problem seemed to be in the date as I already expected. By making an additional formula the problem was resolved. The formula you provided me with seems to be working fine now.

    A million thanks, the help was much appreciated!

    Kind regards,
    Rikkie54321

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,348

    Re: return latest date for a order number that pops up frequently

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  20. #20
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    There is one more problem occuring with the INDEX formula. The formula is working fine, however if I use this for 10,000 cells approxamitely it takes hours to calculate it seems. Could that be right? and is there a solution for this problem?

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,348

    Re: return latest date for a order number that pops up frequently

    You probably should have mentioned the size of your dataset before we started!

    Are you using full column references (e.g. A:A) in your formula?

  22. #22
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    I'm sorry, I was not aware this might be problematic.


    As for the column references, the formula looks like this: {=INDEX($A$2:$A$15000;MATCH(0;COUNTIF(S$1:S1991;$A$2;$A$15000);0))} so yeah, its using references.. I'm not sure this can be changed though.
    Last edited by AliGW; 07-15-2019 at 11:18 AM. Reason: Please don't quote unnecessarily!

  23. #23
    Registered User
    Join Date
    07-12-2019
    Location
    Boxmeer, Netherlands
    MS-Off Ver
    2016
    Posts
    12

    Re: return latest date for a order number that pops up frequently

    Alright, I've tried to do this with approximately 2000 cells at a time, this still takes 30 - 45 mins at a time. So, although the formula does what I need the only problem is that it takes ages unfortunately.

    If there is a solution for this, I'm all ears.

    Edit: I've been googling on this matter and found another thread on the mrexcel, i'm just not sure how to convert this into my formula, perhaps you can help?

    (Hope I'm allowed to share links from other sites?) : https://www.mrexcel.com/forum/excel-...calculate.html
    Last edited by rikkie54321; 07-16-2019 at 03:41 AM.

  24. #24
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,596

    Re: return latest date for a order number that pops up frequently

    Perhaps replacing the array entered formula, in column J, with the following non-array formula will help:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] return the latest date ?
    By guanqiao in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-29-2015, 06:21 PM
  2. Find latest date in a column and return a value with that date
    By Neyme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2015, 01:50 PM
  3. Replies: 8
    Last Post: 04-08-2015, 10:10 PM
  4. Return latest date for Site
    By bongielondy in forum Excel General
    Replies: 4
    Last Post: 08-26-2014, 10:55 AM
  5. [SOLVED] Return the value from the row with latest date
    By G.Bregvadze in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 09:14 AM
  6. Excel 2007 : Lookup a value and return the latest date
    By pinkshirt in forum Excel General
    Replies: 4
    Last Post: 07-04-2011, 06:13 AM
  7. Return Latest Date from a range of data
    By Kenji in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2010, 06:19 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