ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to count non-empty cells (https://www.excelbanter.com/excel-programming/374627-how-count-non-empty-cells.html)

SteveT[_2_]

How to count non-empty cells
 
I have a range of cells with various values (dates, letter N, letter P). I
want to count the number of cells within the range that don't have the letter
N. I don't want to add contents, just get the number of cells that contain a
value. Can someone tell me how this is done?
--
-----------
Thanks,
Steve

Paul B

How to count non-empty cells
 
SteveT, here is one way,
=COUNTA(A1:A20)-COUNTIF(A1:A20,"n")

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"SteveT" wrote in message
...
I have a range of cells with various values (dates, letter N, letter P).

I
want to count the number of cells within the range that don't have the

letter
N. I don't want to add contents, just get the number of cells that

contain a
value. Can someone tell me how this is done?
--
-----------
Thanks,
Steve




Tom Ogilvy

How to count non-empty cells
 
How does this question relate to your topic.

i = Application.Countif(Range("A1:Z26"),"<N")

j = Application.CountBlank(Range("A1:Z26"))



--
Regards,
Tom Ogilvy


"SteveT" wrote in message
...
I have a range of cells with various values (dates, letter N, letter P). I
want to count the number of cells within the range that don't have the
letter
N. I don't want to add contents, just get the number of cells that
contain a
value. Can someone tell me how this is done?
--
-----------
Thanks,
Steve





All times are GMT +1. The time now is 02:16 AM.

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