View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Macro to Sum Arrays of Various Size

Sans VBA?

In C1, enter

=IF(A2="",SUM(INDEX(B:B,MAX(1,MAX(IF($A$1:A1="",RO W($A$1:A1))))):A1),"")

and copy down.

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ConfusedNHouston" wrote in
message ...
I have about 1500 sets of data in a single column that I need to sum,
individually.

Example

Product A $500
Product A $200
Product A $150

Product B $200
Product B $100

I can write a macro that searches for the empty cell (below $150 for

Product
A and below $100 for product B), and I could then use the sum function;

but
in one case I'm summing 3 terms, in the second case, I'm summing 2. I

don't
know how to "tell the macro" (I'm assuming it's a relative reference

macro),
how to determine the number of terms to sum.

Thanks, as always....