#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default AVERAGEIF

I have a worksheet like:
162-1
162-2
162-3
163-1
163-2
..........
I 'd like to average the group of cells with the same first three digit? I
am thinking about AVERAGEIF function but could not work out? Any help would
appreciate?
Thank you!
Tung
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default AVERAGEIF

Hi,

Assuming that your data below is in range C6:C10, you can use the following
formula where B14 has 162.

=SUMPRODUCT((1*(LEFT(C6:C10,3))=B14)*(RIGHT(C6:C10 ,1)))/SUMPRODUCT(1*(1*(LEFT(C6:C10,3))=B14))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Tung Nguyen" <Tung wrote in message
...
I have a worksheet like:
162-1
162-2
162-3
163-1
163-2
.........
I 'd like to average the group of cells with the same first three digit? I
am thinking about AVERAGEIF function but could not work out? Any help
would
appreciate?
Thank you!
Tung


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 265
Default AVERAGEIF

Assuming that A2:A6 contains the data, C2 contains 162, and C3 contains
163, try...

D2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=AVERAGE(IF(LEFT($A$2:$A$6,LEN(C2))=C2,$A$2:$A$6))

Hope this helps!

http://www.xl-central.com

In article ,
Tung Nguyen <Tung wrote:

I have a worksheet like:
162-1
162-2
162-3
163-1
163-2
.........
I 'd like to average the group of cells with the same first three digit? I
am thinking about AVERAGEIF function but could not work out? Any help would
appreciate?
Thank you!
Tung

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 265
Default AVERAGEIF

Misunderstood.... Maybe this is what you're looking for...

=AVERAGE(IF(LEFT($A$2:$A$6,LEN(C2))+0=C2,RIGHT($A$ 2:$A$6,1)+0))

or

=AVERAGE(IF($A$2:$A$6<"",IF(LEFT($A$2:$A$6,LEN(C2 ))+0=C2,RIGHT($A$2:$A$6
,1)+0)))

The latter allows for empty/blank cells. Note that both formulas need
to be confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

http://www.xl-central.com

In article ,
Domenic wrote:

Assuming that A2:A6 contains the data, C2 contains 162, and C3 contains
163, try...

D2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=AVERAGE(IF(LEFT($A$2:$A$6,LEN(C2))=C2,$A$2:$A$6))

Hope this helps!

http://www.xl-central.com

In article ,
Tung Nguyen <Tung wrote:

I have a worksheet like:
162-1
162-2
162-3
163-1
163-2
.........
I 'd like to average the group of cells with the same first three digit? I
am thinking about AVERAGEIF function but could not work out? Any help would
appreciate?
Thank you!
Tung

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
AVERAGEIF T. Valko Excel Worksheet Functions 9 July 15th 09 07:01 PM
AverageIf TG Excel Discussion (Misc queries) 5 June 10th 08 08:51 PM
Averageif help smeldawg Excel Discussion (Misc queries) 7 April 15th 08 10:28 PM
averageif name Excel Worksheet Functions 1 May 4th 06 05:27 PM
averageif rudy Excel Discussion (Misc queries) 5 April 27th 06 11:20 PM


All times are GMT +1. The time now is 01:45 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"