+ Reply to Thread
Results 1 to 9 of 9

Time lookup

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Time lookup

    Is this possible, I have a start and end time in two cells and what I would like to be able to do is lookup this start and end time and return the time. I have attached an example of what I mean, so in the first example my start time is 7:00 and end time is 12:30 and on the chart I have three times, first is from 6:00-6:30, second is from 12:00-12:30 and third is from 14:00-14:30, therefore the result or answer for example 1 should be :30. For example 2, the sart time is 6:00 and end time is 12:30, thus the answer should be 1:00. Is there a formula that can do this? Thanks!
    Attached Files Attached Files
    Last edited by thecdnmole; 11-29-2020 at 02:43 PM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Time lookup

    shouldn't it just be this?

    < edit >

    per you requirements that you posted and what you asked about, this can be done simply subtracting the earlier time from the later time. excel returns a time difference, like what you asked about, by default when you do this. if you're looking for other formats later on when you expand on your efforts, other methods would probably have to be used. see attached book for an example.
    Attached Files Attached Files
    Last edited by vba_php; 11-29-2020 at 02:57 AM.

  3. #3
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Time lookup

    Sorry vba_php, your answer is not what I was asking, which maybe I wasn't clear about. The chart below with the three thirty minute intervals it what needs to be searched, not the difference in time of the two search examples. See if I can explain this differently, I want to be able to search for a time in the chart that is between the start/end time in the two examples, thus in the first example it should return 30 minutes and in the second it should return one hour.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Time lookup

    i don't see any chart.

  5. #5
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Time lookup

    I highlighted it in yellow to make it clear.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Time lookup

    If I understand correctly try this in cells C2:C3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  7. #7
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Time lookup

    Almost FlameRetired! It works for the two examples on the SS, but if I change the time to 6:00-13:00, by the chart I should get 1:00, but the formula returns :30.

  8. #8
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Time lookup

    Quote Originally Posted by FlameRetired View Post
    If I understand correctly try this in cells C2:C3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I had to make a slight change in the last < to > and now it appears to work! Although because the time is converted to a number I have problems with that even though you enter 14:30, it's not the same as another 14:30 because of conversion to a number in Excel. But, according to rules, that is another question to pose, but it appears for the most part I think this one can be considered solved!

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Time lookup

    Good to hear.
    Thanks for the for the feedback, added rep and marking your thread Solved.

+ 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] Lookup if Time Between
    By SofaQueen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-02-2020, 06:09 PM
  2. [SOLVED] Lookup Date and Time
    By ynab in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2020, 01:16 PM
  3. Help with lookup at the same time using a value
    By ngoma in forum Excel General
    Replies: 1
    Last Post: 04-06-2014, 09:27 AM
  4. [SOLVED] Time Lookup
    By seanyc in forum Excel General
    Replies: 2
    Last Post: 06-19-2012, 05:10 PM
  5. Lookup value for certain time
    By novice2430 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2008, 07:00 PM
  6. time lookup
    By armyaviatr in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-08-2005, 10:05 AM

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