+ Reply to Thread
Results 1 to 8 of 8

Match by product ID number, then by date

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Match by product ID number, then by date

    Hello

    I am looking for a formula that contains both an exact match criteria to locate a product ID number, and then a "<=" match to find the last date the product's price was updated. The formula would allow me to link pricing information from one table to another on separate worksheets.


    Table 1: "Price Tracker" where I enter a date, product ID and price. Every time there is a new price for the same product, I start a new row with a new date, the same product ID and an updated price.

    Table 2: "Stock Tracker" where I enter a date, product ID and quantity. I would like to use a formula that will search Table 1 to match the product ID and then return the price that is/was in effect based on the date when the stock entry was made.


    =INDEX($D$2:$D$17,MATCH(MIN(ABS(IF($A$2:$A$17=G2,$C$2:$C$17,999999)-I2)),ABS(IF($A$2:$A$17=G2,$C$2:$C$17,999999)-I2),0))

    This array formula above that I found in this thread partially works, but it does not match the right price if I have more than 1 price update in Table 1.

    I can supply a sample excel file to help illustrate what I'd like to accomplish.

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    11-20-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Match by product ID number, then by date

    Please attach a sample excel file

  3. #3
    Registered User
    Join Date
    12-29-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Match by product ID number, then by date

    Here is the sample workbook with the 2 tables on separate worksheets. The formula should evaluate the "Date", "Type" and "Product ID" from the Price Tracker worksheet and return the value to the Stock Tracker worksheet in the column highlighted in yellow. Feel free to let me know if you need more clarification.

    Thank you again for your help!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-20-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Match by product ID number, then by date

    it is good one. I know it can be done. Give me some time please. I will be back soon

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Match by product ID number, then by date

    may be this in 'Stock Tracker'!D2, drag-filled down:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 02-05-2013 at 08:49 PM. Reason: updated to include "cost" component
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  6. #6
    Registered User
    Join Date
    12-29-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Match by product ID number, then by date

    Wow thanks icestationzbra, you're formula is exactly what I need, well almost!

    The only thing left to include a reference for in the formula is: to only include entries (i.e. rows) in the query that have a Type set to "Cost". In this case, the values that will appear in the Stock Tracker worksheet will be costs from the Price Tracker worksheet, thus ignoring entries with Type "Price".

    Thanks again for your help!

  7. #7
    Registered User
    Join Date
    12-29-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Match by product ID number, then by date

    Any ideas on how to get the formula to consider only rows with Type "Cost"?
    Thanks

  8. #8
    Registered User
    Join Date
    12-29-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Match by product ID number, then by date

    Thank you icestationzbra, your Excel skills have really helped me in this situation!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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