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

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

**Excel:** `=MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1)` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Punch |  | Date | First in |
| 46083.33194444444 |  | 2026-03-02 |  |
| 46083.50069444445 |  | 2026-03-03 |  |
| 46083.52013888889 |  | 2026-03-04 |  |
| 46083.69027777778 |  |  |  |
| 46084.34166666667 |  |  |  |
| 46084.711805555555 |  |  |  |
| 46085.325694444444 |  |  |  |
| 46085.49652777778 |  |  |  |
| 46085.66527777778 |  |  |  |

Formula in D2, filled to D4: `=MINIFS($A$2:$A$10,$A$2:$A$10,">="&C2,$A$2:$A$10,"<"&C2+1)`

Result: 7:58 AM; 8:12 AM; 7:49 AM

## 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.

## Other ways

- `=MIN(FILTER($A$2:$A$10,INT($A$2:$A$10)=C2))`: Keeps 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(…),"")`.

## 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`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/first-clock-in-of-each-day
