Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros for calculating a new average after inserting a new row


I was wondering if anyone could help me with this ~~
I am working on a spreadsheet and I need to come up with a macro
that will check all the number in the cells of Column B, so basicall
checking row by row. If the number in the cells match, I need to tak
the data from the W cell of that row, and keep a running total of th
data in the W cell. All at the same time, I need to keep a count o
how many cells in Column B have the same number, so that I can divid
the running total by this number to find the average score of all thes
cells.

For example:

Column B Column W
101 3
101 3
101 6
102 7

In this case, the first 3 rows have the same number for column B. Sinc
they are the same, I need to add the numbers in Column W of those row
together , so 3+3+6. Then, since I have counted 3 rows, to find th
average I need to divide 3+3+6 by 3.

Thanks =

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros for calculating a new average after inserting a new row


Sorry!! I forgot something. I have found a formula that solves m
previous question, BUT my problem now is, if I insert a new row, how d
I change my formula so that it still does the same thing? I'm usin
=SUM(w3:w9)/Rows(W3:W9) to sum the rows and divide by the number o
rows. But, if i insert a new row, the formula doesn't add the value o
the new row into it. Help!

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading SQL Table into Excel and calculating/inserting group line (with VBA)? Claudia d'Amato Excel Discussion (Misc queries) 2 January 11th 09 02:53 PM
Calculating Average ub Excel Discussion (Misc queries) 2 July 16th 08 05:14 PM
Inserting worksheet calculations into macros arlen andrews Excel Worksheet Functions 4 August 15th 07 12:54 PM
Calculating the average Andy_Trow Excel Discussion (Misc queries) 3 July 27th 07 02:15 PM
Inserting commands in Macros Norton704 Excel Worksheet Functions 1 July 28th 05 06:32 PM


All times are GMT +1. The time now is 04:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"