Forum Discussion
COUNTIF help
Does COUNTIF support references to other sheets in the same workbook? Excel is telling me I haven't specified enough arguments, but I've supplied 2, just like in the examples. What am I doing wrong, please?
4 Replies
- OlufemiOBrass Contributor
Hello pfmxli,
Yes, COUNTIF does support referencing other sheets in the same workbook — but the formula needs to be formatted correctly.
From your screenshot, it looks like you're using:
=COUNTIF(Results!D3:DResult!D27,">0")
Excel is throwing the “too few arguments” error because the range reference is invalid. Specifically, D3:DResult!D27 isn’t a proper range.
It’s trying to span across sheet names or misformatted references, which Excel can’t interpret.Try this instead:
=COUNTIF(Results!D3:D27, ">0")
This tells Excel to count all cells in D3:D27 on the Results sheet that are greater than zero.
That should work just fine.If you're trying to count across multiple sheets, that’s a different situation.
COUNTIF and COUNTIFS don’t support 3D references like Sheet1:Sheet5!D3:D27.
You will need to either:- Use helper formulas on each sheet and add them together: =COUNTIF(Sheet1!D3:D27, ">0") + COUNTIF(Sheet2!D3:D27, ">0") +
- Or use SUMPRODUCT with INDIRECT if you want something more dynamic.
No need to share your data, this is just a syntax fix.
Let me know if you want help building out a multi-sheet solution. - Harun24HRBronze Contributor
Based on language and regional settings, you may need use semicolon (;) instead of comma (,). Then you may try =COUNTIF(Results!D3:D27;">0")
- pfmxliCopper Contributor
Thank you!!! I just wasn't seeing that stupid bracket!
- OliverScheurichGold Contributor
=COUNTIF(Results!D3:Results!D27,">0")
=COUNTIF(Results!D3:D27,">0")
These formulas have two arguments and return the intended result in my sample file. In your formula is one closing bracket too many.