Calculating Sum question.

  • Thread starter Thread starter jmon
  • Start date Start date
J

jmon

Hi,

I am new to Excel programming, and not sure if this even requires
macro or not, but here goes.

I want some function, combination of functions, or macros to scan th
first column under Name: and the second colum under Data:(see below).


Note: The name is consecutively sorted already.

If the names match the cell directly below it, then take the sum of th
respective Data: cells, and put the results in the column directly t
the right of that.

Then continue scanning the Name: and Data: columns. If there is n
match just copy the cell one over to the right Result cell. See Tes
B:

This will stop when a blank cell is encountered.


Name: Data: Result:
TEST A 100
TEST A 250 350
TEST B 50 50
TEST C 40
TEST C 50
TEST C 30 120

Any help will be greatly appreciated.

Thank you in advance,
JMO
 
Assume you data starts in A1. In C2

put in the formula
=IF(AND(A2<>A1,A2<>A3),B2,IF(AND(A2=A1,A2<>A3),SUMIF(A:A,A2,B:B),""))

then drag fill down your column.

in C1
=if(A1<>A2,B1,"")
 
Back
Top