How to Count Unique Usage Days for a Vehicle in Excel
Question details
The user needs to count the exact number of distinct dates a specific vehicle appears in a report, ignoring multiple entries for the same vehicle on the same day.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Analyzing vehicle usage logs or fleet reports where a single vehicle might complete multiple trips and generate multiple log rows on a single date.
- Observed behavior
- A standard counting formula counts every single trip, but the goal is to extract the count of unique operational days for the target vehicle.
Ensure your columns for Vehicle IDs and Dates are perfectly aligned (e.g., both ending at row 1000) and verify that the date column contains valid date values rather than formatted text strings.
Use an Array Formula with SUM, IF, and COUNTIFS
This method accurately identifies distinct dates by calculating the reciprocal of the total occurrences of each vehicle-date combination, bypassing duplicates.
This approach uses a combination of SUM, IF, and COUNTIFS to assign a fractional value to duplicate dates. For example, if a vehicle was used 4 times on the same date, each entry is assigned a value of 1/4. Summing these fractions yields exactly 1 for that unique date.
Locate your vehicle IDs and usage dates. For this example, assume vehicle IDs are in A2:A1000 and the dates are in D2:D1000.
Select an empty cell, such as G2, and type the specific vehicle ID you want to calculate the unique usage days for.
Select the cell where you want the result to appear (e.g., H2). Type the following formula exactly as written: =SUM(IF($A$2:$A$1000=G2,1/COUNTIFS($A$2:$A$1000,G2,$D$2:$D$1000,$D$2:$D$1000)))
Instead of pressing Enter, press Ctrl+Shift+Enter on your keyboard. Excel will wrap the formula in curly braces {}, confirming it is registered as an array formula, and display the accurate unique day count.

Use UNIQUE and FILTER Functions (For Modern Versions)
If you are using a newer version of Excel or WPS Spreadsheet that supports dynamic arrays, this modern formula is much shorter and easier to read.
Easily Count Distinct Values with WPS Spreadsheet
WPS Office offers a fully compatible and highly efficient Spreadsheet tool that effortlessly handles complex array formulas to process your vehicle reports and other large datasets with ease.
- 1. Open Your Dataset: Launch WPS Spreadsheet and open your vehicle usage report.
- 2. Set Up Your Target Identifier: Input the specific vehicle ID you want to track into an empty cell, such as G2.
- 3. Input the Formula: Select your output cell and enter the provided SUM and COUNTIFS formula.
- 4. Execute as an Array: Press Ctrl+Shift+Enter simultaneously to successfully apply the array calculation and retrieve your distinct day count.

Frequently Asked Questions
Why does my array formula return a #DIV/0! error?
A #DIV/0! error usually occurs if the data ranges include blank cells or if the specified ranges for vehicle IDs and dates are not exactly the same size. Ensure both ranges (e.g., A2:A1000 and D2:D1000) correspond perfectly and do not include empty rows.
Can I count unique values using a Pivot Table instead of a formula?
Yes. If you add your data to the Data Model when creating a Pivot Table, you can use the 'Distinct Count' feature. Place the Vehicle ID in the Rows area, drag the Date field to the Values area, click 'Value Field Settings', and select 'Distinct Count' at the bottom of the list.
What happens if I just press Enter instead of Ctrl+Shift+Enter?
In older software versions, just pressing Enter will cause the formula to either return a #VALUE! error or display an incorrect result, because it will not evaluate the entire array of data properly. You must use Ctrl+Shift+Enter.
How do I ensure my date column is formatted correctly?
Select your date column, right-click, and choose 'Format Cells'. Under the 'Number' tab, select 'Date' and pick an appropriate format. If the dates were imported as text, you might need to use the 'Text to Columns' feature under the Data tab to convert them into true date values.




