View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Sum above columns until non-numeric encountered

On Mon, 29 Jul 2013 15:10:03 +0100, stevenswj wrote:


How to write such a formula?

In other words it stops summing the #s when the column header is
encountered. There may be multiple column headers. Thanks!

Your question is not clear.

For example, if this is what you are looking for:

$A$1: Label1 0
$A$2: 1 10
$A$3: 2 9
$A$4: 3 7
$A$5: 4 4
$A$6: 0
$A$7: 0
$A$8: Label 2 0
$A$9: 5 35
$A$10: 6 30
$A$11: 7 24
$A$12: 8 17
$A$13: 9 9
$A$14: Label 3 0
$A$15: 16
$A$16: 14 16
$A$17: 2 2

Try this formula:

This formula must be **array-entered**:

C1: =SUM(OFFSET($A1,0,0,IFERROR(MATCH(TRUE,ISTEXT(A1:$ A$1000),0),1000)))

and fill down as far as required. "1000" should be some number representative of the maximum number of rows this data table might possibly contain

----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.