PDA

View Full Version : How to find the Count of Records in List in atleast one-null scenario?



prabhafriend
05-27-2010, 01:59 PM
How to find the Count of Records in Excel List when All of the Listcolumns atleast have a null in it?

Bob Phillips
05-27-2010, 02:45 PM
I understand all of the words but not the sentence.

Aussiebear
05-27-2010, 11:05 PM
I think prabhafriend is trying to count all cells used in a range

prabhafriend
05-28-2010, 01:07 AM
Ok. Lets Explain this way. We are making a list for the Range A1:C6. Obviously A1:C1 is the HeaderRow Range. Let's Add the TotalRowRange of Sum in the Listcolumn C. Summing is not a problem, We will exactly get the sum. Now I want to Count the Records (Count of Databodyrange.rows). I know I can get it by adding a count in the Totalrowrange in any of the column in that list. The problem is 'Count' skips the null values in the column. I don't have any primary keys(columns which don't have null in that). What do to in this scenario? How to count the no.of records?

Bob Phillips
05-28-2010, 03:47 AM
Sum will not return a null, even if its source cells are null, so COUNT includes it.

prabhafriend
05-28-2010, 03:51 AM
Friend. Count is Ignoring Null Values. For If my ListColumn(1) is having values 1,(null),2,3,5. Count of that returns only 4. But I want the list of records. i.e How?

Bob Phillips
05-28-2010, 03:58 AM
I didn't say Count, I said Sum. You said ... Let's Add the TotalRowRange of Sum in the Listcolumn C... so I am saying just count those.

prabhafriend
05-28-2010, 05:07 AM
I tried counting those. the problem is when there is a null value comes in that column, it skips that. That is the actuall problem.

Bob Phillips
05-28-2010, 05:36 AM
We are going round in circles here, but how can there be a null value if it is a sum of the rest of the row?

prabhafriend
05-28-2010, 05:44 AM
I want to count the records in ListcolumnA. ListColumnA has a Null value in one of its cell. The Count in the totalrow counts only the filled cells but I want the total count including the non-filled cells. What to do?

mdmackillop
05-28-2010, 05:53 AM
=COUNT(H1:H9)+COUNTBLANK(H1:H9)

Bob Phillips
05-28-2010, 06:01 AM
=COUNT(H1:H9)+COUNTBLANK(H1:H9)

How about just

=9

prabhafriend
05-28-2010, 06:25 AM
xld. Getting that 9 is the problem. Activesheet.Listobjects(1).Databodyrange.Columns(1).cells.count Gives the Count of Cells in the Entire List Range. What is the Easiest Way to get that 9.