Count non blanks against formula

Caly

Board Regular
Joined
Jul 19, 2015
Messages
159
Office Version
  1. 365
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
I have a formula in a cell that will return either data or leave the cell blank. I want to do a count that will show the number of lines that has data but when I do this, the formula includes the cells that are blank. How can I exclude those? I think it is because the formula doing the count thinks there is data since it is a formula and it is not hard coded.
Formula in the cell is
=if(A1=“Yes”,”Yes”,””)

the formula to do the count is below but it includes the blank cells
=countif($A$1:$A$3,”<>”)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
A few options:

Book1 (version 1).xlsb
ABCDE
1YesYes222
2 
3YesYes
Sheet32
Cell Formulas
RangeFormula
C1C1=COUNTIF(B1:B3,"Yes")
D1D1=SUMPRODUCT(--(B1:B3<>""))
E1E1=COUNTA(B1:B3)-COUNTBLANK(B1:B3)
B1:B3B1=IF(A1="Yes","Yes","")
 
Upvote 0
This worked perfectly. Thank you so much
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

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