Excel - calculate a time field, based on another time field, and criteria

SarSto 0 Reputation points
2024-08-27T05:56:15.6866667+00:00

Hi,

Lets say we have a scenario of test types. We have tests 1-8 Each of these tests required a delay time, but we want to calculate the time we start the test, based on the time we want to finish this test.

So lets say Test 1 requires a finish time of 1pm, but has a 1 hour delay. How can I add 1pm to field, select my test type as 1, and then have it return, in another cell, a start time of 12pm.

Likewise Test 2 requires a finish time of 1pm, but has a 3 hour delay. How can I program excel to look to the test number field and the finish field to calculate the required start time? The tests will always have a static (but different each test) delay time.

Test number Start Time Finish Time
1 1:00pm
2 1:00pm

Thanks for your assistance.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiajing Hua 18,140 Reputation points Moderator
    2024-08-27T08:35:48.23+00:00

    Hi @SarSto

    The tests will always have a static (but different each test) delay time.

    Can you list the delay time for each test, like the follows?

    User's image

    If yes, you may try the formula to get the Start time, in my example the formula could be =TEXT((HOUR(G2)-VLOOKUP(E2,A$1:B$3,2,TRUE))/24,"hh:mm AM/PM")

    User's image

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.