Spreadsheet Practice

How to find the first clock-in time for each day in Excel

Formula (Excel and Google Sheets)

=MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1)

Use MINIFS with a one-day window: =MINIFS(punches,punches,">="&C2,punches,"<"&C2+1).

Result on the example
one result per row in D2, filled down to D4
Works in
Excel 2021, 2024 and Microsoft 365
Google Sheets
Same formula

See it work

The formula is already in D2, filled down to D4. Change any input and the result updates, or edit the formula to experiment.

How it works

A day runs from midnight up to, but not including, the next midnight, so the two conditions keep the punches on C2's date. MINIFS returns the earliest of them, and the cell's time format shows only the clock time.

=MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1)

Result46083.33194

  1. $A$2:$A$109 rows × 1 col: 3/2/2026 7:58, 3/2/2026 12:01, 3/2/2026 12:29, 3/2/2026 16:34, …

    A range: 9 cells in one column.

  2. C23/2/2026

    The value in C2.

  3. ">="&C2">=46083"

    The & operator joins as text.

  4. C2+146084

    The + operator adds.

  5. "<"&C2+1"<46084"

    The & operator joins as text.

  6. MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1)46083.33194

    MINIFS: Smallest value that meets every condition.

    • min_range$A$2:$A$109 rows × 1 col: 3/2/2026 7:58, 3/2/2026 12:01, 3/2/2026 12:29, 3/2/2026 16:34, …
    • criteria_range1$A$2:$A$109 rows × 1 col: 3/2/2026 7:58, 3/2/2026 12:01, 3/2/2026 12:29, 3/2/2026 16:34, …
    • criteria1">="&C2">=46083"
    • criteria_range2$A$2:$A$109 rows × 1 col: 3/2/2026 7:58, 3/2/2026 12:01, 3/2/2026 12:29, 3/2/2026 16:34, …
    • criteria2"<"&C2+1"<46084"

In Google Sheets

The same formula works in Google Sheets: =MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=MIN(FILTER($A$2:$A$10,INT($A$2:$A$10)=C2))7:58 AM, 8:12 AM, 7:49 AMKeeps the punches whose date part is C2, then takes the earliest. Excel 365 and Google Sheets.

Common mistakes

  • A night shift that starts before midnight and ends after it spans two dates. Group those by shift, not by calendar day.
  • MINIFS returns 0, shown as 12:00 AM, for a day with no punches. Wrap it: =IF(COUNTIFS(…),MINIFS(…),"").

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Find the first clock-in time for each day

In D2, return the earliest punch on the date in C2, and fill down to D4.

Questions

How do I get the last clock-out?

Use MAXIFS with the same conditions: =MAXIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1).

How do I get the hours between the first and last punch?

=(MAXIFS(…)-MINIFS(…))*24.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.