Solution 1 – Insert an Inverted Comma While Using Text Value
In the following dataset, we haven’t inserted the text within the double quotation, so the formula has returned 0.
Steps:
- Select cell D15 and enter the following formula:
=COUNTIF(B5:E13,"Computer")
B5:E13 is the range, and “Computer” is the criteria for the COUNTIF function.
- Press Enter. You will get the total number of sold Computers which is the return of the COUNTIF function. The return is 3.
Read More: [Fixed] COUNTIF Function with Wildcard Not Working in Excel
Solution 2 – Apply Actual Logical Operators While Using Values from Other Cells
Steps:
- Enter the following formula in cell B16:
=COUNTIF(E5:E13,">"&E15)
- Press Enter. You will get the total revenue earned over $60000, which is the return of the COUNTIF function. The return is 3.
Solution 3 – Using OR Logic to Avoid Returning 0
Steps:
- Enter the following formula in cell E15:
=SUM(COUNTIF(D5:E13,{"Computer","Fridge"}))
COUNTIF(D5:E13,{"Computer","Fridge"})
will count the number of Computers and then count the number of Fridges.- After that, the SUM function will sum up the total number of Computers and Fridges.
- Press Enter. You have solved the problem.
Read More: Excel COUNTIF to Count Cell That Contains Text from Another Cell
Solution 4: – Using Wildcards If the COUNTIF Function Is Returning 0
Steps:
- Enter the following formula in cell B16:
=COUNTIF(B5:E13,"*Oven*")
- Press Enter. You will get the return of the COUNTIF function.
#N/A! error arises when the formula or a function in the formula fails to find the referenced data.
#DIV/0! error happens when a value is divided by zero(0) or the cell reference is blank.
Read More: How to Use COUNTIF Function to Count Text from List in Excel
Download the Practice Workbook
Download this workbook to practice.
Related Articles
- Count Text at Start with COUNTIF & LEFT Functions in Excel
- How to Use the COUNTIF Function In Excel to Count Bold Cells
<< Go Back to Excel COUNTIF Function | Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!
SUPER HELPFUL, THANKS!
Hello Dwbi,
You are most welcome.
Regards
ExcelDemy