i am trying to use COUNTIF on an excelsheet:
=COUNTIF(E$6:E$13;“>0”)
this returns 1, however:
=COUNTIF(MyTable[MyColumn];“>0”)
is evalulated properly
MyColumn is a column in my table which is exactly covered by the E$6:E$13 expression.
My expectation would be that both formulas evaluated correctly.
please investigate this issue.
Summary
You are seeing different results for the two COUNTIF formulas:
=COUNTIF(E$6:E$13,">0") // returns 1
=COUNTIF(MyTable[MyColumn],">0") // returns the expected count
The structured‑reference version works, while the plain‑range version does not.
Why it happens
Locale‑dependent list separator – In some regional settings Excel uses a semicolon (;) as the argument separator, in others a comma (,). If the workbook’s locale does not match the separator you use, the formula may be parsed incorrectly, leading to an unexpected result.
Numbers stored as text – Cells E6:E13 might contain values that look like numbers but are actually text (e.g., because they were imported or entered with a leading apostrophe). COUNTIF treats text‑numbers differently from true numeric values, so only the cells that Excel recognises as numbers are counted.
Mixed data types – A mixture of true numbers and text values in the same range can cause COUNTIF to return a count that seems too low.
Structured reference handling – When you refer to a table column (MyTable[MyColumn]), Excel automatically interprets the data type of the column, which can mask the text‑number issue that appears when you use a plain range.
What to do next
Check the list separator – Try both separator styles in the same workbook:
Use the one that matches your regional settings.
2. Verify the data type of each cell – In a helper column, enter:
=ISNUMBER(E6)
Copy the formula down to E13. Any FALSE indicates a text value.
3. Convert text numbers to real numbers – You can:
Select the range, go to Data → Text to Columns, click Finish.
Multiply the range by 1 (e.g., =E6*1) and copy‑paste values back.
Use Paste Special → Values → Multiply with the number 1.
Re‑enter the formula after conversion – Once all cells are true numbers, the plain‑range COUNTIF should return the same result as the structured reference.
If the issue persists – Create a minimal workbook that reproduces the problem (the table, the values in E6:E13, and both formulas) and share it with the support team for further investigation.
Following these steps should help you identify why the plain range behaves differently and bring both formulas in line.
Note: The answer is based on general Excel behaviour; no specific Aspose.Cells version details are required for this issue.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@careall
By creating a sample file and testing it on the latest version v25.11 using the following sample code, we can obtain the correct results. Please refer to the attachment. result.zip (17.7 KB)