Excel Formula to Count People Checked In at the Same Time
Question details
Calculate the number of people currently checked in at each new check-in time using date and time values.
- Product
- Excel 2019
- Device & OS
- not provided
- Scenario
- Tracking concurrent attendance or room occupancy by analyzing a dataset of check-in and check-out timestamps.
- Observed behavior
- Requires a dynamic formula that evaluates previous check-out times against the current row's check-in time to return a running count of concurrent users.
Ensure your check-in and check-out columns are properly formatted as Date and Time values, and sort your entire dataset by the check-in time in ascending order.
Use the COUNTIFS Function with Dynamic Ranges
This method uses an expanding cell range to count how many previous check-outs happen after the current row's check-in time.
By anchoring the start of the range and leaving the end relative (e.g., $B$2:B2), the formula only checks records up to the current row. It evaluates if the check-out time of previous entries is greater than the latest check-in time, effectively counting those who are still checked in.
Select your entire data range and sort the check-in column (e.g., Column A) in ascending order from oldest to newest.
In the first cell of your result column (e.g., D2), enter the formula =COUNTIFS($B$2:B2,">"&MAX($A$2:A2)) where A is the check-in column and B is the check-out column.
Make sure the comparison operator is enclosed in quotes and concatenated with the function using an ampersand, like ">"&MAX($A$2:A2). If your data is strictly sorted, ">"&A2 will also work.
Click and drag the fill handle at the bottom-right corner of cell D2 down to apply this logic to the rest of your data rows.
Manage Date and Time Data Efficiently in WPS Spreadsheet
WPS Spreadsheet seamlessly handles complex date-time calculations, dynamic arrays, and the COUNTIFS function, making attendance tracking effortless without needing a separate database.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the raw check-in and check-out logs.
- 2. Apply the dynamic COUNTIFS formula: Type the COUNTIFS formula into the target column, utilizing absolute and relative references to create an expanding range just as you would in Excel.
- 3. Drag to calculate all rows: Double-click the fill handle at the bottom right of the active cell to instantly calculate concurrent check-ins for thousands of entries.

Frequently Asked Questions
Why is the ampersand (&) symbol required in the COUNTIFS formula?
In spreadsheet formulas, logical operators like ">" or "<" must be written as text strings inside quotation marks. The ampersand (&) is used to concatenate (join) this text string with a cell reference or formula output, allowing the criteria to be evaluated properly.
Can I calculate concurrent check-ins if my data is not sorted?
Yes, but you cannot use an expanding range. You must evaluate the entire dataset for each row using a formula like =COUNTIFS($A$2:$A$100,"<="&A2,$B$2:$B$100,">"&A2), which counts all records that checked in on or before the current row and checked out after it.
Why does my COUNTIFS formula return 0 even with overlapping times?
This typically occurs when your date and time values are stored as plain text rather than recognized serial numbers. Right-click your data cells, choose 'Format Cells,' and apply a valid Date/Time format. You may also need to double-click the cells and press Enter to refresh the data type.




