How to Compare Time Difference with Certain Time in Excel

Sometimes we need to count time difference when participating a contest or an exam, and if the time difference (between start time and end time) is greater than certain time, participants are failed in the contest. So, in this situation we need to know the method to compare time difference with certain time. This article will introduce you a quick method to fix this issue.

Precondition:

Prepare a table record the start time and end time of a contest. And if time difference is greater than 2 hours, participators fail the contest, on the other side, if time difference is less than 2 hours, they pass the contest. We need to enter PASS or FAIL in column C.

Compare Time Difference with Certain Time 1

Method: Compare Time Difference with Certain Time in Excel


Step 1: In C2 enter the formula =IF(B2 > A2 + TIME(2,0,0),”FAIL”,”PASS”). In this formula, if B2 is greater than A2+2 hours, then formula returns FAIL, otherwise it returns PASS.

Compare Time Difference with Certain Time 2

Step 2: Drag the fill handle down to fill B3:B6. Verify that B3:B6 are filled with FAIL or PASS.

Compare Time Difference with Certain Time 3

We can see that in this example, only two people pass the contest.

Comment:

  1. As TIME(HOUR,MINUTE,SECOND), so we can change hour/minute/second values per our real demands. If we want compare time difference with 2 hour 5 minutes 10 seconds, we can update the formula as =IF(B2 > A2 + TIME(2,5,10),”FAIL”,”PASS”).

Related Functions


  • Excel TIME function
    The Excel TIME function returns a date in serial number format for a particular time (the hour, minute and second).The syntax of the TIME function is as below:= TIME(hour, minute, second)…
  • Excel IF function
    The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE. The IF function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])….
Related Posts

Fix #N/A Error For VLOOKUP From Another Sheet
vlookup from anther sheet not working1

This post will show you how to fix the #N/A error why it occurs when you extract values from another sheet using VLOOKUP function in Excel 2016,2013,2010 or other Excel versions. How can you correct a #N/A error in VLOOKUP ...

How to Average Only Positive or Negative Numbers of a Range

Suppose both positive numbers and negative numbers exist in a table. If we want to know the average of only positive numbers in this table, we can create a formula to get average of all positive numbers with all negative ...

VLOOKUP with Two Lookup Tables

VLOOKUP is one of the key functions among all lookup & reference functions in Excel. Today we will show you the application of VLOOKUP function when there are two lookup tables. EXAMPLE Table1 and table2 record the rates of Y2020 ...

Approximate Match with Multiple Criteria by INDEX & MATCH
Approximate Match with Multiple Criteria by INDEX & MATCH 1 & 2

In Excel, INDEX function and MATCH function are often used together for returning data from specific position. And MATCH function is one of Excel lookup & reference functions that can return approximate value by setting match type. Above all, through ...

How to Statistic Pass 4 Out of 5 Rounds in a Competition by Excel Functions
Statistic Pass 4 Out of 5 Rounds 1

Suppose you are counting the numbers of participants who are the winners in a competition. And the passing line is provided as pass 4 out of 5 rounds of games. You need to know if participant pass the game or ...

Average the Last N Numeric Values in Excel
Average the Last N Numeric Values 7

AVERAGE function is one of the most popular functions in Excel. Apply AVERAGE together with some other functions, we can calculate average simply for some complex situations. In this article, we will introduce you to calculate average of the last ...

How to Average and Ignore Errors in Excel
average and ignore errors2

This post will guide you how to average a list of values and ignoring any errors in the given range in Excel 2013/2016 or Excel office 365. You can use the AVERAGEIF function or AGGREGATE function to calculate the average ...

How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column
How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column14

Sometimes we may meet the case that subtotal values for different groups and only record a subtotal value for one group in a column, for other cells in this group, keep them blank. Today we will introduce you how can ...

Running Count of Occurrence List
running count of occurrentce in list2

This post will guide you how to get running count of an occurrence in a list with formula in Excel 2013/2016 or Excel office 365. How to create a running count of certain values that appear in the given range ...

How to Count Unique Numeric Values with Criteria in a Range in Excel
count unique numeric values criteria9

We have talked that how to count unique numeric values in a data set in Excel in the previous post. And this post will guide you how to count unique numeric values with criteria in the range in Excel 2013/2016 ...

Sidebar