Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Count blank cells and cells with text

Is there a function which adds up both blank cells and cells with text? I
know I can do it with countA + countblank, but one function would work better.

thanks much for your help.

RK
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Count blank cells and cells with text

RK,

That should be a constant....unless your range is dynamic. But, to answer
your question, there is no single worksheet function that will work the way
you want it to, unless you have a single row or column, in which case
COLUMNS or ROWS will work as well.

Bernie


"rk0909" wrote in message
...
Is there a function which adds up both blank cells and cells with text?
I
know I can do it with countA + countblank, but one function would work
better.

thanks much for your help.

RK



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Count blank cells and cells with text

If the range of cells you want to count is in a single column, you can just
subtract the row numbers (plus 1):

=ROW(B20)-ROW(B5)+1

To count all cells in any range, you can use this user-defined function.
Paste it in a VBA module:

Public Function CountCells(Target As Range) As Long
CountCells = Target.Cells.Count
End Function

You would call it like this:
=CountCells(B5:B20) or
=CountCells(test) if 'test' is a named range.

If you are new to VBA, this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

If you want to count all the cells in a range which do not have numbers in
them then an array formula like this should work:

=SUM(IF(ISNUMBER(A5:B20),0,1))

For an array formula, instead of Enter, you have to press Ctrl + Shift +
Enter. If you do it right, Excel will add curly braces around the formula.
You can then copy/drag it like other formulas, but if you edit it, you have
to use Ctrl + Shift + Enter again.

Hope this helps,

Hutch

"rk0909" wrote:

Is there a function which adds up both blank cells and cells with text? I
know I can do it with countA + countblank, but one function would work better.

thanks much for your help.

RK

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Count blank cells and cells with text

Try this:

=SUMPRODUCT(--(A1:C12=0))


"rk0909" wrote:

Is there a function which adds up both blank cells and cells with text? I
know I can do it with countA + countblank, but one function would work better.

thanks much for your help.

RK

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i count specific text strings excluding blank cells? skijsh1979 Excel Worksheet Functions 2 June 14th 07 06:37 AM
Formula Help: Add cells with certain text + cells that are blank Nicole L. Excel Worksheet Functions 3 February 27th 07 06:59 AM
How do I count cells with text but ignore cells with spaces? Husker87 Excel Discussion (Misc queries) 2 September 21st 06 12:31 AM
How to count blank cells (Rows) between Non-Blank cells in Col "A" Dennis Excel Discussion (Misc queries) 8 July 20th 06 11:25 PM
Do Not count blank cells imjustme Excel Discussion (Misc queries) 4 November 1st 05 04:44 PM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"