+ Reply to Thread
Results 1 to 3 of 3

VLOOKUP not working as intended

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    8

    VLOOKUP not working as intended

    I’m having trouble with VLOOKUP working incorrectly. I am using it to calculate how long my breaks should be based on how long my hours are.

    In one row I can have:
    Start – 07:00, Finish – 13:00, Break – 00:15 (Incorrect, it should be 00:30)

    But in the second row I have:
    Start – 08:00, Finish – 14:00, Break – 00:30 (Correct, for every 6 hours I work I receive an unpaid 30 minute break)

    I am at a loss on how to fix this. Cell formatting is the same across all cells.

    The problem is clearly shown on the spreadsheet itself.
    Attached Files Attached Files
    - RAS 2112

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: VLOOKUP not working as intended

    try this formula

    =VLOOKUP(TIME(HOUR(E20)-HOUR(D20),MINUTE(E20)-MINUTE(D20),),$M$7:$N$11,2,1)

  3. #3
    Registered User
    Join Date
    03-04-2013
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    8

    Re: VLOOKUP not working as intended

    That seems to have done it. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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