Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to calculate average last N values in a table in Excel
  • Conditional Formatting Icon Sets Examples in Excel
  • How to sum a total in multiple Excel tables
  • Conditional Formatting Data bars Examples in Excel
  • How to create dynamic reference table name in Excel

References

  • How to get last row in text data in Excel
  • How to use Excel ROW Function
  • How to use Excel MMULT Function
  • Two-way lookup with VLOOKUP in Excel
  • MATCH function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Excel Data validation must contain specific text
  • Prevent invalid data entering in specific cells
  • Excel Data validation exists in list
  • Excel Data validation specific characters only
  • Excel Data validation date in specific year

First in, last out times in Excel

by

This tutorial shows how to calculate First in, last out times in Excel using the example below;

Formula

=MINIFS(times,names,name,actions,action)

>

Explanation

To get “first in, last out” times from timesheet data, you can use the MAXIFS and MINIFS functions, or an array formula as described below. In the example shown, the formula in H6 is:

=MINIFS(times,names,H5,actions,"in")

with the following named ranges: actions = C5:C22. names = B5:B22, times = E5:E22

How this formula works

The MINIFS function is designed to return minimum values in a range based on one or more criteria. In this case, the range we are extracting a minimum value from is E5:E22), named “times”.

We are filtering these values first using two range/criteria pairs. The first pair provides a range of B5:B22 (names), with the name in H5 for criteria. The second pair uses the range C5:C22 (actions), with “in” as a criteria.

MINIFS then returns the earliest (minimum) time where name is “Max” and action is “in”.

The “last out” time is calculated in a similar way with the MAXIFS function:

=MAXIFS(times,names,H5,actions,"out")

Array formula alternatives

The MAXIFS function and MINIFS function were both introduced in Excel 2016. If you are using an older version of Excel, you can use an array formula instead:

{=MIN(IF(names=K5,IF(actions="in",times)))}
{=MAX(IF(names=K5,IF(actions="out",times)))}

Note: these are array formulas and must be entered with control + shift + enter. Excel will add the curly braces automatically.

Post navigation

Previous Post:

How to use Excel CHOOSE Function

Next Post:

Customize Ribbon In Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • AND function: Description, Usage, Syntax, Examples and Explanation
  • OR function: Description, Usage, Syntax, Examples and Explanation
  • Check multiple cells are equal in Excel
  • Extract multiple matches into separate rows in Excel
  • How to use Excel TRUE Function

Date Time

  • How to enter Today’s Date or Static Date and Time in Excel
  • How to calculate future date say 6 months ahead in Excel
  • How to calculate most recent day of week in Excel
  • Count day of week between dates in Excel
  • WEEKNUM function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Group numbers with VLOOKUP in Excel
  • Group times into 3 hour buckets in Excel
  • Group numbers at uneven intervals in Excel
  • How to randomly assign people to groups in Excel
  • Map inputs to arbitrary values in Excel

General

  • Check if multiple cells have same value in Excel
  • Find, Trace and Correct Errors in Excel Formulas using ‘Formula Auditing’
  • How to Insert Cells, Row and Rows in Excel
  • Freeze and Unfreeze Panes in Excel
  • Customize Ribbon In Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning