+ Reply to Thread
Results 1 to 13 of 13

vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

  1. #1
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    In attachment Raw Data sheet is lookup table.
    In Sheet 1 all cells are formulas except A2.
    All lookups in column B work until row 22 where I had to replace the formula for A22 [from A21] with direct data [copied from the table].
    If you copy the date formula down from the cell above - A21 - the lookup fails as do all those below it. I have even shown the numerical format for this data on the right which doesn't change using the formula.
    Attached Files Attached Files

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    how can you say it failed?

    i look at it manually and they are correct.
    24/01/2015 11,860.3
    31/01/2015 10,842.6
    7/02/2015 11,444.5

    time is all 4:00:00 PM
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Hi Ralph and welcome to the forum,

    Try the Approx form of VLookup with the True instead of Exact or False. Change formula to this
    =VLOOKUP(A21,'Raw Data'!$A$4:$B$7491,2,TRUE)

    My guess is rounding error or something. I get what you are asking but don't have a better answer than make it True.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Yes, thank you MarvinP. Using TRUE works. I suspected it was some sort of obscure accumulated rounding error even though the formula's numeric value was identical to that for the direct data.

    However, what this means is that all dates from row 22 onwards are only approximations to those in the lookup table and presumably the differences a likely to increase. At what point does this difference become too great so that another value in the table is a better approximation?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Hey Ralph,

    Remember you need to sort your data from small to big if your use the "TRUE" in the VLookup. Maybe you should use an MRound() formula on your date and times to get them to the closest minute. Maybe a False would work then with the VLookup??

  6. #6
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Thanks again Marvin,
    Thanks for the reminder on sorting with TRUE but the table is progressively populated so there's no problem there. As for the possibility of "approximation drift" over time, the data is logged ever 30 minutes and the numerical difference is 0.0208333334012423 which I don't think will worry me [i.e. in my lifetime]. Thank you again for your solution.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Here's an alternative way of selecting the time slot (16:00 every day) that is chosen. I used offset to calter the date and Index Match to return an exact match
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  8. #8
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    I spoke too soon. I find that TRUE is giving me the data for 3:30 PM so it must be selecting the largest value in the table which is less than the reference value [not the closest value to the reference value]. I'll try my luck with MRound() !

  9. #9
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    It is finally working using ROUND() with TRUE. Doesn't work otherwise.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Did you take a look at ghe OFFSET solution?

  11. #11
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Hi Vladimir.
    Sorry, but if it was that easy I wouldn't have needed the forum. Clearly operating with date values to the exactitude required by VLOOKUP is rather a dark art. I'll be putting this experience under my belt for future reference. The forum has indeed been helpful.

  12. #12
    Registered User
    Join Date
    02-16-2015
    Location
    Little Hartley, Australia
    MS-Off Ver
    Standard 2010
    Posts
    7

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    Hi Glenn
    Yes, I did but the lookup table is imported from elsewhere so I don't want to lean too heavily on is structure or completeness. I need to be able to define the data I need without making such assumptions.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,116

    Re: vlookup of date/times created by formula A2=A1 + 7 fails after 20 rows

    OK. Fair enough. I had assumed that if the data was logged every 30 minutes, that there would always be 48 rows between every 1600 reppt time. Hence my choice of OFFSET.

+ 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. vlookup 2M+ rows -- crashing, long processing times etc.
    By daisydaisy in forum Excel General
    Replies: 10
    Last Post: 07-22-2014, 06:02 PM
  2. Replies: 2
    Last Post: 05-28-2014, 06:52 AM
  3. [SOLVED] Chart range created from formula fails
    By BRISBANEBOB in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-17-2013, 03:35 AM
  4. Vlookup formula to return multiple cells (x) times.
    By Choppo in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-17-2013, 10:00 AM
  5. How to avoid excess rows created by a formula?
    By etrader in forum Excel General
    Replies: 4
    Last Post: 07-19-2009, 04:58 PM

Tags for this Thread

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