LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lazzaroni
 
Posts: n/a
Default Count Non-Blank Rows

Can anyone suggest a more flexible substitute for the following formula? It
effectively counts the number of non-blank (0) rows in an array. This
formula is limited, however, in that every column requires a separate
statement. I would like to find a function that could handle an array of any
size with a single statement.

1 0 0
1 1 0
0 0 0
0 0 1

3=SUM(IF((A1:A40)+(B1:B40)+(C1:C4),1,0))

It would be nice to use something like the array formula 1=OR(A1:C10) for
every row in the entire array. Unfortunately, according to this document AND
and OR functions cannot be nested within SUM+IF statements:

http://support.microsoft.com/kb/267982/EN-US/

This is the VBA equivalent of what I am trying to do with an Excel formula:

Dim oRow As Range
Dim cNonBlanks As Long

For Each oRow In Range("50:80").Rows
If Application.CountA(oRow) < 0 Then
cNonBlanks = cNonBlanks + 1
End If
Next oRow

Thanks
 
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
Can I develop a macro to add blank rows to a list in Excel? csimont Excel Discussion (Misc queries) 1 January 18th 06 02:46 PM
Pivot Tables & not printing blank rows (revisited) [email protected] Excel Worksheet Functions 1 August 4th 05 07:42 AM
Display count of rows Judy Ward Excel Worksheet Functions 2 June 23rd 05 07:23 AM
Getting Count field to recognise rows with negative values in Exc. hamish Excel Worksheet Functions 2 June 20th 05 05:06 AM
How to delete blank rows John Mansfield Excel Discussion (Misc queries) 3 April 27th 05 11:48 PM


All times are GMT +1. The time now is 10:48 AM.

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"