Function Problems

Tag Excel Times as HIT or MISSED with an IF Formula

Natalie TaylorNatalie Taylor Dec 2, 2026 868 views

Question details

Create a formula that compares times in two Excel columns and labels each row HIT or MISSED.

Tag Excel Times as HIT or MISSED with an IF Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
Compare the time in column S with the time in column W for each row.
Observed behavior
A row should show MISSED when the time in column S is later than the time in column W, and HIT when it is equal or earlier.
Before you start

Check that columns S and W contain valid Excel time values, not times stored as text. Identify the first row to compare and choose an empty output column other than S or W.

Solution 1Recommended

Compare the two times with an IF formula

Use this formula to mark later times as MISSED and equal or earlier times as HIT.

1
Select an output cell

In Excel, select an empty cell on the first data row, such as X10, alongside the times in S10 and W10.

2
Enter the formula

Type =IF(S10>W10,"MISSED","HIT") in X10 and press Enter. Change the row number or column letters if your times are elsewhere.

3
Fill down

Select X10 and drag its fill handle down the output column to apply the formula to the remaining rows.

Compare the two times with an IF formula
Comparing across midnight: If the times span different dates, include the correct dates in both values; time-only values do not indicate which day each time belongs to.
Compare times in WPS Spreadsheets

Label times as HIT or MISSED in WPS Spreadsheets

Open your spreadsheet in WPS Spreadsheets and use the same IF formula to compare times and label each row.

  1. 1. Open the workbook: In WPS Spreadsheets, open the workbook containing the times in columns S and W.
  2. 2. Choose an output cell: Click an empty cell on the first data row, such as X10.
  3. 3. Enter the formula: Type =IF(S10>W10,"MISSED","HIT") and press Enter. Adjust the references to match your sheet.
  4. 4. Apply it to other rows: Select the formula cell and drag its fill handle down to label the remaining rows.
Compare two time columns with an IF formulaOpen and save Microsoft Excel XLSX filesFill a formula down multiple rowsEdit spreadsheets with a familiar interface
QA img-9

Frequently Asked Questions

What happens when the two times are equal?

The formula =IF(S10>W10,"MISSED","HIT") returns HIT because S10 is not later than W10.

Can I put the formula in column W?

Not if the formula refers to the same cell in column W. Enter it in a separate output column, such as X, to avoid a circular reference.

Why might the formula give an unexpected result?

Check that both cells contain actual time values rather than text. Also check for date components: Excel compares the full date and time values, even if only the times are displayed.

How do I compare times that cross midnight?

Enter the correct date and time in each cell before comparing them. A time-only value does not show whether it belongs to the previous or next day.