excel macro help plz!


Diamond Member
Oct 26, 1999
i have 60,000 rows with 3 columns:

id# station result
5453 1
5453 2
5453 3
4321 1
4321 2
4321 3

there are 20 different numbers that have 3 stations each so theres 5453, 4321 and 18 others... and each has a result of 0 or 1

so this repeats itself for 60,000 rows so theres 1000 groups of 20 numbers with 3 stations each (total of 60 per group)

i hope this isnt too confusing... so what i need to do is write a macro that parses the entire list, or maybe just a group of 60 values (and id just repeat it manually), and calculates the average result for each station. the way that the results were generated sucks because it is grouped by id# and not station which would make it a lot easier...

if anyone has any clue how to get started or have any help to offer if greatly appreciate it!


Diamond Member
Oct 26, 1999
im trying to help a friend and she didnt explain it to me properly... she just needs 1 average result for each station for all of the id#s so its as simple as sorting by station and then calculating the average of the selection of all 20,000 numbers for that station


Feb 29, 2000
1. highlight the range
2. click Data
3. click PivotTable And Pivot Report...
4. Click Next
5. Click Next
6. Click layout
7. drag the ID# to the Row field
8. drag the Station to the column Field
9. drag the result to the data field
10. double click result
11. choose average from the summarize by: list
12. Click ok
13. Click finish. Viola, you've got a pivottable.