+ Reply to Thread
Results 1 to 4 of 4

Thread: matching different dates and their values

  1. #1
    Registered User
    Join Date
    06-24-2008
    Posts
    6

    matching different dates and their values

    Hello, im having trouble matching different excel dates with values.
    I have a list of two data, say the daily spot oil price and daily closing prices of a stock.
    I have the past 8 years data on both and values on each date, but on some days, either market was closed due to holidays and whatnot.

    Like my oil prices start 2 jan 2003 and my stock starts 1 jan 2003, and then some are the same and some different. I want to match 1 date with the two values corresponding to the stock price and oil price without having to individually delete the dates from 2003 to 2010 where dates do not match

    How would i do this in excel?
    Ive attatched the file for further clarification.
    Cheers.!
    Attached Files Attached Files

  2. #2
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: matching different dates and their values

    Try this,

    Cheers,
    Attached Files Attached Files
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: matching different dates and their values

    A slightly different alternative to the above but using the same setup

    A2:D2: enter 0
    
    G3:
    =IF(LOOKUP($F3,$A$2:$A$1988)=$F3,LOOKUP($F3,$A$2:$B$1988),"")
    copied down
    
    H3:
    =IF(LOOKUP($F3,$C$2:$C$1988)=$F3,LOOKUP($F3,$C$2:$D$1988),"")
    copied down
    the above utilises binary search given the data is sorted by date and should calculate a bit quicker as a result.

  4. #4
    Registered User
    Join Date
    06-24-2008
    Posts
    6

    Re: matching different dates and their values

    thank you so much guys!
    the vlookup is very useful!

+ 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.2.0