+ Reply to Thread
Results 1 to 9 of 9

Making a list of items, then showing the date the item was last ordered

  1. #1
    Registered User
    Join Date
    04-24-2008
    Posts
    9

    Making a list of items, then showing the date the item was last ordered

    This is kind of a corollary to this post but I thought it warranted its own thread.

    Is there any way a list could be generated of all the items we have ordered from our wholesaler (i.e. duplicates removed and only unique values remaining) and then in the next column along a vlookup or similar could return the LAST time the item was ordered?

    If it helps to look at this problem from a "why is that useful" perspective, it would allow me to see if there are products we have probably run out of because we haven't ordered them for ages.

    MANY THANKS!

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Making a list of items, then showing the date the item was last ordered

    yes, you can extract from a List and not have duplicates , then you can use a MAX IF to lookup the value


    this will return the max value
    =MAX(IF($A$1:$A$20=C2,$B$1:$B$20))
    Assuming the range was A1:B20
    C2 would be the value to lookup

    This should extract the unique list

    =IFERROR(INDEX($A$2:$A$29, MATCH(0, COUNTIF($B1:B$1, $A$2:$A$29), 0)),"")

    both entered as arrays with control+shift+enter to get {} around the formula

    can you attach a sample spreadsheet please

    there are a few alternatives fo rthe extraction formula
    =IFERROR(INDEX(A2:A29,MATCH(0,INDEX(COUNTIF($B$1:B1,A2:A29),,),)),"")
    =IFERROR(INDEX($A$2:$A$60,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$60),0,0),0)),"")
    which do not need to be an array

    example sheet here

    So you can see how extract works and MAX with criteria
    Attached Files Attached Files
    Last edited by etaf; 06-25-2014 at 03:45 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-24-2008
    Posts
    9

    Re: Making a list of items, then showing the date the item was last ordered

    Hi Wayne

    I attach sample.xlsx a sample (much reduced!) spreadsheet. I've tried playing around with your examples but I think I must have explained the particular situation poorly as I can't get it to work or perhaps - get my head around how I should use the formula! :-)

    Basically what I'm after is the LAST (most recent) date a particular product is ordered.

    many thanks

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Making a list of items, then showing the date the item was last ordered


  5. #5
    Registered User
    Join Date
    04-24-2008
    Posts
    9

    Re: Making a list of items, then showing the date the item was last ordered

    Odd - Thank you Kalak - I can see the button but the macro seems to be corrupted because when I open the file I get a message about damage, and upon clicking the button I'm told there is no code to run??

  6. #6
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Making a list of items, then showing the date the item was last ordered

    hmm...
    v. strange
    i have just re-downloaded the file directly from my Post 4 above, clicked the button and it ran just as intended.

    however, here's the VBA code behind it, which you might like to place in a VBA module in your sample.xlsx file , which would of course need to be macro-enabled first (becoming sample.xlsm) and then run the code manually
    if it works for you, then you can easily assign it to the button anytime you like
    Please Login or Register  to view this content.
    it uses the dictionary object which works with most (since maybe 1997) versions of windows, but not on macs where you'd need some modifications.

  7. #7
    Registered User
    Join Date
    04-24-2008
    Posts
    9

    Re: Making a list of items, then showing the date the item was last ordered

    Quote Originally Posted by kalak View Post
    it uses the dictionary object which works with most (since maybe 1997) versions of windows, but not on macs where you'd need some modifications.
    I think that was the problem :-) I tried it from a Mac. I'm now running Windows. It now seems to work nicely, thank you! Now I can just do a sort by cell colour?

    MANY THANKS!

  8. #8
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Making a list of items, then showing the date the item was last ordered

    Now I can just do a sort by cell colour?
    Maybe.

    But better I think to do it directly as part of the code and then put in colours if you want these.

    Do you want the relevant rows (as colored in red) at the bottom? at the top? in what order?, or perhaps (as you suggested in your opening post) all others deleted entirely?

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Making a list of items, then showing the date the item was last ordered

    Pl see attached file formula in Sheet2.
    Attached Files Attached Files

+ 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] Extracting summary list of larger list showing only items that have quantities
    By BenjaminRCP in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-14-2014, 01:01 PM
  2. Replies: 0
    Last Post: 08-21-2012, 11:35 PM
  3. Formula to return last date an item ordered
    By ExcelJunior in forum Excel General
    Replies: 6
    Last Post: 05-17-2011, 12:37 AM
  4. Making a list of checked items
    By aburnce in forum Excel General
    Replies: 1
    Last Post: 12-27-2008, 07:29 PM
  5. items to be ordered, help?
    By 207 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2006, 06:00 PM

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