ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   count function (https://www.excelbanter.com/excel-discussion-misc-queries/186277-count-function.html)

Darts via OfficeKB.com

count function
 
I want to count cells going across but do not want to count that cell if it
is blank or has a 0
Example =count(e4:I4) the answer returns 5 however in cell f there is no
data so the answere should be 4. how can i write a formula so if the cell is
blank or has 0 it does not count that cell.

thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200805/1


Pete_UK

count function
 
Try this:

=COUNTIF(E4:I4,"<") - COUNTIF(E4:I4,0)

The first term will ignore blanks and the second term will count the
zeros and subtract them.

Hope this helps.

Pete

On May 6, 1:47*am, "Darts via OfficeKB.com" <u19990@uwe wrote:
I want to count cells going across but do not want to count that cell if it
is blank or has a 0
Example =count(e4:I4) the answer returns 5 *however in cell f there is no
data so the answere should be 4. *how can i write a formula so if the cell is
blank or has 0 it does not count that cell.

thanks

--
Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/ms-excel/200805/1



Darts via OfficeKB.com

count function
 
thanks works great!!!

now what if I have no how can i tell it not to count no but have it count yes

Pete_UK wrote:
Try this:

=COUNTIF(E4:I4,"<") - COUNTIF(E4:I4,0)

The first term will ignore blanks and the second term will count the
zeros and subtract them.

Hope this helps.

Pete

I want to count cells going across but do not want to count that cell if it
is blank or has a 0

[quoted text clipped - 6 lines]
--
Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/ms-excel/200805/1


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200805/1



All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com