adding values from a newly inserted row

D

debbz82

Hi~
I am trying to work on a spreadheet for work. I have two column
from my spreadsheet that I need to work with. First, I am lookin
through the spreadsheet row by row and any row that has the same valu
in their Column B, I need to add together their values in Column W. A
the same time, I need to keep count as to how many rows have the sam
Column B value so that I can find the rows average score. I use
average(w3:w9) to find the average score, but this only works when non
of data is altered. If i insert a new row, the new row's values ar
not calculated in.

The data are grouped in a way so that all the rows w/ the same value i
column B are in the same group, with the first row of each group havin
the column B value, and a average score column. The macros I though
about writing for this problem would be: if the rows after that firs
row have the same value as they do in Column B, then add their Colum
w's value, and then at the same time keeping track of how many row
have the same Column B value. ANy help would be appreciated. Thanks!!

Debbi
 
D

Dave Peterson

If your data is already sorted nicely (by column B), try Data|Subtotal and
choose average as the function for column W.

If the data isn't sorted (and you don't want to sort it), try:
data|Pivottable

You can drag the header for column B to the row field. The header for column W
to the data field (and double click on it to choose Average).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top