Back to journal
JOURNAL

My Spreadsheet Found Thirty-Three Days in a Month

April 2025: a route-dashboard calculation exposed the difference between a unique timestamp and a unique calendar day.

April 14, 2025 · A dashboard calculation

My dashboard had a list of routes, each linked to its own worksheet. I was using VBA to bring order totals and delivery-success counts back into a central view.

Then I added Total Days. For each route, I wanted to count the distinct calendar dates in Date Submitted. Ten orders recorded on one day should still count as one day. Daily success calculations would build on that number.

The workbook came back with an extraordinary result: thirty-three days in a month.

There was nothing extraordinary about the calendar. The calculation was treating different times on the same date as separate values.

A formatted date isn't necessarily a date-only value

I pointed out that the source field contained both date and time. Changing the cell's appearance doesn't remove the time from the underlying Excel value. If a routine uses the full timestamp as its unique key, it counts unique moments—not distinct days.

I was also careful about where the bug was. I said the other parts of the macro performed well. That's valuable feedback. A specific bad calculation shouldn't erase everything that works; it should tell us where to focus.

We had already been through several errors and revised code. When the same issue came back again, I challenged the repetition directly and asked for the code to be reviewed before another run. Repeating a failed test without changing the reason for failure isn't progress.

A dashboard can present the wrong number beautifully. In this case the number was obviously impossible, which made the problem easy to spot. A smaller counting error would have been more dangerous.

If the day count is wrong, the performance rate built on it won't become right just because it has two decimal places.

All writing