View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Get number of rows that data takes up, including blank rows

Try one of these:

=SUM(A1:INDEX(A:A,MATCH(2,1/(1-ISBLANK(A1:A65535)))))
Note: that is an ARRAY FORMULA and must be committed by holding down [ctrl]
and [shift] when you press [enter]

OR
=SUM(OFFSET(A1,,,SUMPRODUCT(MAX((ROW(A1:A10000))*( A1:A10000<"")))))
Note: that formula contains OFFSET(), which is a volatile function and my
impact recalc performance in complex workbooks. It is a Non-array formula
(just press [enter])

OR
=SUM(A1:INDEX(A:A,SUMPRODUCT(MAX((ROW(A1:A10000))* (A1:A10000<"")))))
(Non-array, no volatile functions)

Adjust range references to suit your situation.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Denham Coote" wrote:

I have a column which contains numeric values. Some rows may NOT contain a
value (ie: they're blank).

Short of filling in all the blanks with 0's, how might I be able to get the
ROW number of the final data entry?

To explain further, I am using the following formula:

=SUM(OFFSET(A1,0,0,COUNTA(A:A)))

This allows me to sum all the values in column A, using A1 as a reference
point, and making the range depth the value of the non-blank cells found by
COUNTA. Problem is, if there are blank values in between non-blank values,
the offset doesn't include those, and therefore the range depth is smaller
than the row number of the final data entry.

Hopefully, by obtaining the ROW number, I'll be able to specify that as the
offset value, as opposed to using COUNTA().

I hope I've put this clearly enough. (I've tried to keep the concept basic -
the actual formula that it will apply to is way to long and beyond the scope
of this posting)

Thanks in advance for your help.

Regards,

Denham.