ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   average values and reduce and simplify the worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/188455-average-values-reduce-simplify-worksheet.html)

Omics

average values and reduce and simplify the worksheet
 
I have a Excel2003 worksheet containing 2 columns and more than 20,000 rows.
Column B lists the names of objects and column A lists the values of
repeated measurements for each object. The repeating times of measurement
vary from object to object. I will need to average the measurement values for
each object, and reduce the table to one object with one average value. Could
somebody tell me how to do this? Thanks.

Example:
From:
A B
1.8099 aa
1.8685 aa
1.8081 aa
2.0376 aa
1.4996 aa
1.984 aa
0.4723 bb
0.3107 bb
0.4174 bb
0.2281 cc
0.3621 cc
0.3618 cc
0.1087 cc
0.2929 cc
2.5983 dd
2.1616 dd


To:
1.8346 aa
0.4001 bb
0.2707 cc
2.38 dd


jlclyde

average values and reduce and simplify the worksheet
 
On May 22, 12:03*am, Omics wrote:
I have a Excel2003 worksheet containing 2 columns and more than 20,000 rows.
Column B lists the names of objects and column A lists the values of
repeated measurements for each object. The repeating times of measurement
vary from object to object. I will need to average the measurement values for
each object, and reduce the table to one object with one average value. Could
somebody tell me how to do this? Thanks.

Example:
From:
A * * * B
1.8099 *aa
1.8685 *aa
1.8081 *aa
2.0376 *aa
1.4996 *aa
1.984 * aa
0.4723 *bb
0.3107 *bb
0.4174 *bb
0.2281 *cc
0.3621 *cc
0.3618 *cc
0.1087 *cc
0.2929 *cc
2.5983 *dd
2.1616 *dd

To:
1.8346 *aa
0.4001 *bb
0.2707 *cc
2.38 * *dd

Omics,
You can do this with code, but here is a non code way. Highlight all
of the aa's bb's and so on. Click on Data/Filter.../Advanced Auto
Filter. Click on copy to another location. Choose said location.
then select uniques values. Then next to this new column of data add
this formula =SUMIF(B$2:B$17,E2,A$2:A$17)/COUNTIF(B$2:B$17,E2) If the
data is in a as numbers and B for what to lookup. Copy this down to
all cells. Then you can copy and paste special/ Values and then you
could delete the old stuff. If you want.

Thanks,
Jay

Bob Phillips

average values and reduce and simplify the worksheet
 
You can use a simpler array formula

=AVERAGE(IF(B2:B17=E2,A2:A17))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"jlclyde" wrote in message
...
On May 22, 12:03 am, Omics wrote:
I have a Excel2003 worksheet containing 2 columns and more than 20,000
rows.
Column B lists the names of objects and column A lists the values of
repeated measurements for each object. The repeating times of measurement
vary from object to object. I will need to average the measurement values
for
each object, and reduce the table to one object with one average value.
Could
somebody tell me how to do this? Thanks.

Example:
From:
A B
1.8099 aa
1.8685 aa
1.8081 aa
2.0376 aa
1.4996 aa
1.984 aa
0.4723 bb
0.3107 bb
0.4174 bb
0.2281 cc
0.3621 cc
0.3618 cc
0.1087 cc
0.2929 cc
2.5983 dd
2.1616 dd

To:
1.8346 aa
0.4001 bb
0.2707 cc
2.38 dd

Omics,
You can do this with code, but here is a non code way. Highlight all
of the aa's bb's and so on. Click on Data/Filter.../Advanced Auto
Filter. Click on copy to another location. Choose said location.
then select uniques values. Then next to this new column of data add
this formula =SUMIF(B$2:B$17,E2,A$2:A$17)/COUNTIF(B$2:B$17,E2) If the
data is in a as numbers and B for what to lookup. Copy this down to
all cells. Then you can copy and paste special/ Values and then you
could delete the old stuff. If you want.

Thanks,
Jay




All times are GMT +1. The time now is 08:34 PM.

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