rows.com

When Your COUNTIFS Misses a Row, Check the Data Logic

Are you frustrated that your COUNTIFS formula isn’t delivering the expected results?

2 min readMicrosoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Here's a common frustration: your formula looks correct, the logic is sound, but the result is wrong. This user's COUNTIFS is returning 1 when it should return 2, and they've narrowed the problem to row 28. Changing G28 to roughly 2.1 or lower makes the count work. That's not a bug in the spreadsheet. That's a data logic trap, and it's one of the most insidious ways spreadsheets waste your time.

What's happening here is almost certainly a floating-point precision issue. Column F and column G likely contain decimal values that appear identical when displayed, but their underlying binary representations differ by a tiny fraction. The formula "G < F" evaluates that microscopic difference as false, so the row is excluded. The user's test, setting G28 to 2.1, works because the new value is clearly smaller, bypassing the precision mismatch. For anyone managing financial data, performance metrics, or any numeric comparison, this is the kind of silent failure that erodes trust in your own work.

Our take is straightforward: when your COUNTIFS misses a row, don't assume the formula is broken. Check the data logic first. The spreadsheet is doing exactly what you told it, but what you told it may not match what you see. Round your comparison values explicitly, or use a small tolerance like `ROUND(G,2) < ROUND(F,2)` to strip away the invisible noise. This isn't a flaw in the tool, it's a reminder that precision has a cost, and that cost shows up when you least expect it.

The practical takeaway is simple. Next time a conditional count feels wrong, isolate the row that should be included and test the comparison manually. If it evaluates to FALSE when you expect TRUE, look for floating-point drift. Then adjust your logic to handle it. That's not a workaround. That's how you build spreadsheets that actually reflect reality. Stop hunting phantom bugs and start auditing your thresholds.

From Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

I've linked the data here: https://i.imgur.com/UHC2ngj.png

I am comparing two columns, include in the count if both:

Read the original at Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community