+ Reply to Thread
Results 1 to 10 of 10

Different Dates

  1. #1
    Registered User
    Join Date
    02-19-2018
    Location
    Bristol,England,
    MS-Off Ver
    Excel 2016
    Posts
    13

    Different Dates

    Hi everyone,

    I need a helping hand with cleaning my time-series data as I have to collect a couple of variables on a daily basis between 2005-2010. However, some of the variables don't have matching dates, e.g the London Stock Exchange doesn't record the closing value of the FTSE100 index on weekends/no-trading days whereas pollution stations around the city measure levels of pollution every day. Is there any way I can use the dates of the FTSE100 as the only date axis/column and delete the dates from column A that don't match with the ftse100 dates? I could go manually but then I need to do this for another 8 years of daily observations and will be too complicated/time consuming to do it manually and I need this data clean for my final year econ dissertation. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Different Dates

    Create a new column A.
    In A2 paste this formula and then drag down


    =IF(ISNA(VLOOKUP(B2,$G:$G,1,0)),VLOOKUP(B2,$G:$G,1,1),VLOOKUP(B2,$G:$G,1,0))


    Is this what you are looking for?
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Different Dates

    So you only want to use the dates in Column F? or only dates that are both in A and F (some dates in F are not in A).?

    If the first option, it might be easiest, if in Col G, G2 copied down and right
    =IFERROR(ROUND(VLOOKUP($F2,$A$1:$D$1790, COLUMNS($H$1:I$1),FALSE),1),"")
    Then you can place them all into a single chart, each column being a different series and using a secondary vertical axis. See attached.
    Is that what you are looking for?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    02-19-2018
    Location
    Bristol,England,
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Different Dates

    Hi,

    I copied the formula and I have been given some random numbers which don't look right. Might be me doing it wrong. In case you didn't quite understand what I am after: In column A I have date in the form off dd/mm/yy and for each day I have a value assigned for all the variables such as windspeed, pm10 etc. This basically summarizes all the values recorded for the variables on a specific date on this row. However, if you look into the FTSE100 dates, they differ because the stock exchange doesn't trade on certain dates like Christmas so there will be missing dates in column E when you compare it to column A. I need to keep the values recorded for each of the variables in accordance to the dates from the FTSE100 as I will be regressing the FTSE100 index against the variables so some of the dates in column A are useless and I don't need them. E.g I don't need to know what the windspeed was on 01/01/2006 because the FTSE100 has no recorded closing value for this date. I am trying to sort my variables (closing value of the FTSE100 index, PM10,humidity, windspeed) on a daily basis. Ideally, my 1st date in cell A2 will be 04/01/2005 so I can go and delete the values recorded for windspeed,humidity and PM10 for the 1st,2nd and 3rd of January, but unfortunately the data set is quite big so manually deleting individual dates from column A + the recorded values for the independent variables(humidity,windspeed and PM10) will take a lot of time. Hopefully that helps.
    Last edited by ttony123; 03-04-2020 at 05:19 PM.

  5. #5
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Different Dates

    Im guessing it is showing numbers like 38356 38400 ...etc. This is the actual number value Excel gives a date. Just change the cell formatting of column A to date.
    My formula was looking up the date u have for wind speed etc in your FTSE100 date. If it found the date then it returned itself. If it did not find the date the it does another Vlookup which will return an approximate match.
    So for example take christmas of 2005. The last day FTSE100 has for chrismas is 12/23/2005. The next date FTSE100 has is 12/28/2005. So for dates in Column B 12/23/2005 - 12/27/2005 it will return the date 12/23/2005.

  6. #6
    Registered User
    Join Date
    02-19-2018
    Location
    Bristol,England,
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Different Dates

    Okay, so far so good. I changed it to date and I can see the repeating dates, which in the case mean that FTSE100 has no recordings for those. Does that mean I can just delete the repeating dates and then copy and paste the values for each of the variables? Thanks a lot man btw.

  7. #7
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Different Dates

    Wait, did you just want to delete all rows of your date where there was not a corresponding FTSE1000 date??

  8. #8
    Registered User
    Join Date
    02-19-2018
    Location
    Bristol,England,
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Different Dates

    Yes, pretty much. The observations of the variables on dates that don't correspond to the FTSE100 dates are not needed at all. Useless statistics.

  9. #9
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Different Dates

    then just use this formula instead.

    =VLOOKUP(B2,$G:$G,1,0)

    then coopy paste special values.
    Then Delete all Rows that are #N/A

    You could even throw a filter on and search for #N/A and then delete to make it even quicker.

  10. #10
    Registered User
    Join Date
    02-19-2018
    Location
    Bristol,England,
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Different Dates

    I have the dates now but no observations.

+ 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. Replies: 8
    Last Post: 07-20-2018, 11:52 AM
  2. Populating list of dates from another sheet with Start Dates and End Dates
    By Jesshloly in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2015, 04:07 AM
  3. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 AM
  4. Replies: 6
    Last Post: 03-11-2013, 06:11 PM
  5. [SOLVED] Array of dates when tested shows no dates ......but there are dates
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2012, 12:45 PM
  6. [SOLVED] Highlight Group of Dates if Dates Match List of other Dates
    By martinpgibson in forum Excel General
    Replies: 5
    Last Post: 10-24-2012, 08:14 PM
  7. [SOLVED] Auto filling dates based on previously entered dates and averaging numbers if dates equal
    By grambograham in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 03:21 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