+ Reply to Thread
Results 1 to 12 of 12

Vlook up Max date only for an item with multiple entries with two unique criteria and ret

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    Clearwater, Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Vlook up Max date only for an item with multiple entries with two unique criteria and ret

    Looking at the headers below I want to build a look up formula that will result in the latest (most recent date in list) transaction date (A) for a specific transaction type (B) for the MedID (D) for Station (E) and return the associated information in the desired results format listed below the original format.
    A B C D E
    [TransactionDate] [Transaction] [Med description] [MedID] [Station]

    Desired results format
    A B C D E
    [MedID ] [Station] [TransDate Withdrawn] [TransDate Loaded] [Trans Date Unloaded]

    There are 3 transaction types. Loaded, Unloaded and Withdrawn. What I really need to know looking at over 60,000 lines of data: The date of most recent withrawn for a MedID, the most recent Loaded transaction if there is one and finally the most recent unloaded date is there is one line.
    Any help, suggestions will be appreciated. Thanks
    Last edited by jcicero57; 08-01-2013 at 10:42 PM. Reason: Comply with rules

  2. #2
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: VLook Up Challenge

    Insert new columns to do this. So have a new column which runs along the lines of =IF(C2="","",C2) and then 2 more to do the same but with D2 and E2. These columns will only show dates for Withdrawn, Loaded and Unloaded.

    Then you can use a lookup to find the MedId for each.

    For withdrawn you will be able to use =INDEX(A:A,MATCH(MAX(C:C),C:C,0))
    change to D:D and E:E for the other two.
    Say thanks, click *

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: VLook Up Challenge

    Posting a sample sheet might help

  4. #4
    Registered User
    Join Date
    06-20-2012
    Location
    Clearwater, Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: VLook Up Challenge

    Attached sample file as requested
    Attached Files Attached Files
    Last edited by jcicero57; 07-28-2013 at 11:06 PM.

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

    Re: VLook Up Challenge

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    -------------------------------
    Your post #5 here means that someone must copy that into a worksheet and try to make sense of it...
    To attach a Workbook
    (please do not post pictures of worksheets)
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Ben Van Johnson

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

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    The dates in your sample are string values not dates so the code convert them to dates
    sorts on medit, x-action & x-actiondate
    the main part just creates a pivot table,copies to a new location inserts a column for station
    and autofills that column with a VLOOKUP to get the station:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-20-2012
    Location
    Clearwater, Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    Thank you- Very much

    MeID s are stored at multiple locations Stations with multiple transaction dates.
    It appears that this code does not show the latest (most recent) transaction for the MedID for each specific station.
    I really like the way the code works. If there is not a way to modify code to allow for the latest (most recent) MedID result for each station I can enter data by location and run multiple sheets. In some cases there are over 70 locations. I tried to modify the Duplicate code without success.

    I hope there is a simple solution to this. Thank you again for your help.

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

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    Your sample file only used one Station ID. I sorted the file by MedID as primary but it can be sorted by other fields for for example Station, MedID, TransDate.
    But with present one station sample, there's no way to test that.

  9. #9
    Registered User
    Join Date
    06-20-2012
    Location
    Clearwater, Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    I am very sorry for the confusion. I was trying to keep the sample data small and overlooked that. Thank you very much for your help with this.
    I am looking for the transaction type and date associated with the MEDID by location. So if there were multiple withdrawn transactions on 6/1/13,6/12/13 and 6/24/13 for ID ABC and these transcations for ABC appeared in Stations #1 and Station #2 I want to see the most recent withdawn data including date for ID ABC in Both station #1 and #2.

    Same for the other transaction types.

    Thanks!
    Attached Files Attached Files
    Last edited by jcicero57; 07-31-2013 at 07:12 PM.

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

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    This one should work:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 08-02-2013 at 06:27 PM. Reason: attachment

  11. #11
    Registered User
    Join Date
    06-20-2012
    Location
    Clearwater, Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    Thank you! It works.

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

    Re: Vlook up Max date only for an item with multiple entries with two unique criteria and

    Your date data seems to have both string and numerical values. The modified line in bold should fix that.

    Please Login or Register  to view this content.

+ 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. Challenge: Vlook-up/match with a sumif
    By shanea.kr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2012, 03:27 PM
  2. [SOLVED] VLOOK
    By Domenic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  3. vlook up
    By KL in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  4. VLOOK
    By Adnan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. vlook up
    By Sean in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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