ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Averaging a dynamic range...Help ??? (https://www.excelbanter.com/excel-programming/303665-averaging-dynamic-range-help.html)

wraithlead

Averaging a dynamic range...Help ???
 
I've got basically three columns. ID, description, and numerical value
I would like to get an average of everything with identical ID an
Description, then put that average in the fourth column, but only o
the first instance of the ID and Description. The columns can be sorte
first if it's easier. I don't know how many of each there are.

example:

ID Description Value
Average
1 a 13
13
1 b 10
15
1 b 20
2 a 20
22
2 a 24
3 a 20
24
3 a 22
3 a 26
3 a 28
3 b 27
27


I've never written my own macro, and it's been forever since i eve
modified someone else's. Even just a headstart would be greatl
appreciated.

Ric

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Averaging a dynamic range...Help ???
 
Hi
try the following array formula in cell D2 (entered with
CTRL+SHIFT+ENTER):
=IF(MATCH(1,($A$1:$A2=A2)*($B$1:B2=B2),0)=ROW(),AV ERAGE(IF
(($A$2:$A$100=A2)*($B$2:$B$100=B2),$C$2:$C$100)))

and copy this down

-----Original Message-----
I've got basically three columns. ID, description, and

numerical value.
I would like to get an average of everything with

identical ID and
Description, then put that average in the fourth column,

but only of
the first instance of the ID and Description. The columns

can be sorted
first if it's easier. I don't know how many of each there

are.

example:

ID Description

Value
Average
1 a

13
13
1 b

10
15
1 b 20
2 a

20
22
2 a 24
3 a

20
24
3 a 22
3 a 26
3 a 28
3 b

27
27


I've never written my own macro, and it's been forever

since i even
modified someone else's. Even just a headstart would be

greatly
appreciated.

Rich


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com