Count identical frequencies alongside the mode without extra arrays

In your quest to find the number of values that occur with the same frequency as the mode, it looks like you're on the right track with your formula.

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

This user has hit on a genuinely elegant problem, and their frustration is entirely understandable. The formula they've built is logically sound in isolation, each piece works when tested separately. But the error when they combine the steps reveals a subtle truth about how spreadsheet functions handle arrays internally. Frequency, in particular, expects a specific data structure that doesn't align neatly with the output of Unique when used inside Countif. The user is not making a conceptual mistake; they are running into a limitation of the tool's architecture.

What makes this worth pausing over is the user's instinct to avoid extra arrays in the first place. They want efficiency. They want a single formula that delivers insight without cluttering the sheet with intermediate columns or helper ranges. That is a progressive mindset, one that many spreadsheet users never develop because they've been trained to accept complexity as normal. The user here is pushing against that inertia, and they should be encouraged. Their approach, breaking the problem into steps, testing each, then attempting a synthesis, is exactly how good data work gets done.

The practical fix requires understanding that Frequency returns an array of counts, and Countif expects a range reference, not an array output from another function. The user can achieve their goal by wrapping the Frequency call in a second Index or by using Let to name the frequency array and then applying a conditional count. A cleaner path is to use the mode as a reference point: calculate the frequency of the mode value, then count how many distinct values share that frequency. That sidesteps the array conflict entirely and keeps the formula readable.

This is not a failure of the user's logic. It is a reminder that even well-designed tools have edges where assumptions collide. The user should take confidence in having identified the right question. The answer is within reach, and the approach they've already taken will serve them well on the next problem, and the one after that.

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

I’m trying to write a formula that outputs the number of values which occur in a range of cells the same number of times as the mode, without needing to output an array first. Basically, if the mode is 5, and 5 shows up 13 times in the range, but 3 also shows up 13 times, the formula will output “2”.

This is what I’ve come up with, which I have constructed step by step, and all of the steps work as separate formulas referencing each other, but when I put it all together, I just get an error:

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