The COUNTA function in Excel is used to count the number of non-empty cells within a given range. It includes cells containing numbers, text, logical values, error values, and empty text (“”), but does not count truly empty cells. Here are some examples:
To count non-empty cells in the range B5:B15, use:
=COUNTA(B5:B15) // Returns 9
This counts the 9 non-empty cells in the specified range.
To count both numbers and text values, use:
=COUNTA(1, 2, 3) // Returns 3 =COUNTA(1, "a", "b") // Returns 3 =COUNTA(1, 2, 3, "a", 5%) // Returns 5
To count non-empty cells in multiple ranges (e.g., A1:A10 and C1:C10), use:
=COUNTA(A1:A10, C1:C10)
Remember that COUNTA also includes empty strings (“”), which can be returned by formulas. If you want to ignore empty strings, consider using other functions like COUNT (for numeric values only) or COUNTIF (for specific conditions)
No comments:
Post a Comment