+ Reply to Thread
Results 1 to 9 of 9

vlookup with scroll bar not quite working

Hybrid View

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    7

    vlookup with scroll bar not quite working

    Hi everybody!
    In the attached file i'm trying to have a scrolling list. the problem is that the vlookup is returning #N/A if the scroll value is not divisble by 3. The same lookup value returns a result at different increment values. I can resolve this by having the scroll increment in units of 3 but i would like to know what the problem is.
    Last edited by ternt; 05-22-2017 at 06:29 PM.

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

    Re: vlookup with scroll bar not quite working

    Use this in F4, copied down:

    =$A$4+ROWS($F$4:F4)*$F$2*15/24/60

    In addition there's something very strange about your vlookup. It is saying: Look up this thing. If the answer is zero, put N/A, otherwise look it up again.

    Easier to use:

    =IFERROR(VLOOKUP(F4,$A$4:$D$1769,2,FALSE),"N/A")

    I's advise against using #N/A, as that has a specific meaning in Excel and is a useful diagnostic if/when things go wrong.
    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

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: vlookup with scroll bar not quite working

    @Glenn: maybe 0 is a valid return that the OP needs to replace by N/A. Probably still needs the IFERROR wrapper.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


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

    Re: vlookup with scroll bar not quite working

    Fair point, Trevor... In which case, use:

    =IFERROR(1/(1/VLOOKUP(F4,$A$4:$D$1769,2,FALSE)),"N/A")

    PS. I do like the idea of the scroll bar "not quite" working....like a tyre only being flat at the bottom, or being a little bit pregnant....

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,188

    Re: vlookup with scroll bar not quite working

    To be fair, tyres rarely go flat at the top

  6. #6
    Registered User
    Join Date
    09-20-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: vlookup with scroll bar not quite working

    Hi and thanks for the advice!
    Glenn, in the file that you provided, the difference between the scrolling dates appears to increase the further that i scroll.
    Can you tell me why my original doesn't work i.e. sometimes the lookup value returns a number and sometimes not? Also, i've used the #N/A because i plan to have a scrolling graph and i don't want zeroes when a value isn't returned, i just want a gap in the graph. Is this a situation suited to using #N/A or should i use something else.
    Thanks again

  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 2406
    Posts
    44,662

    Re: vlookup with scroll bar not quite working

    OK. Apols. I must have been asleep when i replied. Your problem is caused by Excel's (in)ability to calculate time (and other numbers) correctly. The system they use is called "Floating Point Arithmetic" and it can cause all sorts of fun. So... although if you do =DATETIME1 = DATETIME2 on two cells, corresponding to a #N/A error, you'll get TRUE, in reality they aren't the same... Confused?? It gets worse. To fix your problem you have to modify the VLOOKUP. Take the lookup date time, multiply it by 1440, round to zero decimal places and divide it by 1440. Bingo. Problem gone....

    So, G4 now looks like this:

    =IFERROR(VLOOKUP(ROUND(1440*F4,0)/1440,$A$4:$D$1769,2,FALSE),NA())

    I take your point about #N/A. I'm 99.9% certain that you have to create it using the NA() function. If you just create text that looks like #N/A, your graph may NOT behave as expected. I haven't checked that, however.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-20-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: vlookup with scroll bar not quite working

    Woohoo!
    Thanks heaps. I thought that it might be something but after getting the return TRUE from =DATETIME1 = DATETIME2 i thought it must be something else.
    Thanks for the lesson.

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

    Re: vlookup with scroll bar not quite working

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] Indirect working on current cell, but not when I scroll down
    By bjcowen9000 in forum Excel General
    Replies: 13
    Last Post: 02-03-2016, 05:42 AM
  2. Pivot Table Scroll not working
    By TroyA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2015, 05:50 PM
  3. Userform with scroll bar not working as expected
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2015, 03:43 PM
  4. Scroll not working in Excel
    By bdcelli in forum Excel General
    Replies: 3
    Last Post: 03-24-2014, 12:28 PM
  5. [SOLVED] Vertical Scroll not working. Excel
    By Cyberpawz in forum Excel General
    Replies: 1
    Last Post: 06-05-2012, 09:43 AM
  6. Object sheet name and scroll limit not working.
    By HuggyBear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2005, 12:40 PM
  7. how to prevent worksheet scroll bar to be bigger than working are.
    By Worksheet AREA in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-16-2005, 03:06 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