Excel: COUNTIF: The formula you typed contains an error

Microsoft ExcelIn Microsoft Excel (part of the Microsoft Office productivity suite), you can count the number of times a string (a piece of text) appears in a range of cells.

Let’s take the following table as an example:

Option AOption BOption CTotals
XX2
X1
XXX3

To get the totals automatically (in other words: how many times does ‘X’ appear in this row?), use the following formula:

=COUNTIF(E4:H4,"X")

The formula says: if in range E4 to H4 the value ‘X’ appears, count this and output the total.

However, upon entering this formula, I received an error prompt telling me:

The formula you typed contains an error.

For information about fixing common formula problems, click help.

To get assistance in entering a function, click Function Wizard (Formulas tab, Function Library group).

If you are not trying ot enter a formulam avoid using an equal sign (=) or minus sign (-) or precede it with a single quotation mark (‘).

So the COUNTIF function is not working? And this error message wasn’t all too helpful either. Luckily, I tried other notations and finally found an answer. I had to replace the comma (,) with a semicolon (;).

The COUNTIF formula now becomes a working one:

=COUNTIF(E4:H4;"X")

 

Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.

 

4 thoughts on “Excel: COUNTIF: The formula you typed contains an error

Leave a Reply

Your email address will not be published. Required fields are marked *