Struggling with Simple Countif function

smalik

Board Regular
Joined
Oct 26, 2006
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I have a column that looks up a value from a table and if the value does not match it results a blank cell.

I am trying to count how many cells have values

Both "Countif" and "Counta" formulas results in the same answer because even if the cell appears blank, it has a formula. How can I count non blank cells in this situation?

Sorry, I cannot use the "addin" to my work computer. Hopefully, the picture does the trick. The yellow cells in this example show a blank cell, but they have a lookup formula.

Column "D" shows the formula I am using to count.

Any help is greatly appreciated.

Thanks in advance.

1643782166978.png
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi smalik,

As B6 and B7 have formulas that even though they are returning blanks they are not empty hence the issue.

Try this:

=COUNTA(B3:B9)-COUNTBLANK(B3:B9)

Regards,

Robert
 
Upvote 0
Hi,

Also try:

Excel Formula:
=SUMPRODUCT(--(B3:B9<>""))

and

Excel Formula:
=SUMPRODUCT((B3:B9<>"")*1)
 
Upvote 0
Solution
Or try
Excel Formula:
=COUNTIF(B3:B9,"?*")
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top