division with blank cells

G

Guest

yes
no
___
___
yes
no
yes
__
FORMULA

Is there a way for me to put a formula in the Formula cell where it would
divide all the yes's by all the no's without counting all the blank cells.
So the formula would read 3/5 (number of filled in cells) instead of 3/8
(number of total cells in range)

Your help is greatly appreciated.
 
D

Dave Peterson

If those empty cells are really empty:

=countif(a:a,"yes")/counta(a:a)

If those cells just look empty (contain formulas that evaluate to "")

=countif(a:a,"yes")/sum(countif(a:a,{"yes","no"}))

This will ignore all value that's not equal to yes or no.
 
B

Bob Phillips

=COUNTIF(A2:A20,"Yes")/COUNTA(A2:A20)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

Something like this prehaps...
=COUNTIF(C1:C8, "yes")/SUM(COUNTIF(C1:C8, "yes"), COUNTIF(C1:C8, "no"))
Format the cell as fraction...
 
G

Gord Dibben

=COUNTIF(A1:A7,"yes")/COUNTIF(A1:A7,"no")

Format as Fraction


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top