Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LynnJ
 
Posts: n/a
Default If/Then calculate the average

I'm trying to find a formula that will calculate the average number of days
it takes for a certain type of material to move through my department. Where
column A is the type of material on a book truck and column I is the number
of days it took for that book truck to move through the department.

If the cells in column A= MUSIC then average the cells of the same row in
column I.

I've been playing with the SUMIF and AVERAGE functions but haven't been able
to figure it out.

It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.

Any help is greatly appreciated.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default If/Then calculate the average

Hi Lynn

I can't see whay that array formula wouldn't work, unless there is
something wrong with the data.

You could try
=SUMPRODUCT(--(A2:A399="MUSIC"),--(I2:I339))/COUNTIF(A2:A339,"MUSIC")


--
Regards

Roger Govier

LynnJ wrote
I'm trying to find a formula that will calculate the average number
of days it takes for a certain type of material to move through my
department. Where column A is the type of material on a book truck
and column I is the number of days it took for that book truck to
move through the department. If the cells in column A= MUSIC then
average the cells of the same row in column I.
I've been playing with the SUMIF and AVERAGE functions but haven't
been able to figure it out.
It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array
formula. Any help is greatly appreciated.






  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default If/Then calculate the average

Try this:
=AVERAGE(IF(A2:A399="MUSIC",I2:I399))
Note: commit that array formula by holding down [Ctrl]+[Shift] and press
[Enter]


Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"LynnJ" wrote:

I'm trying to find a formula that will calculate the average number of days
it takes for a certain type of material to move through my department. Where
column A is the type of material on a book truck and column I is the number
of days it took for that book truck to move through the department.

If the cells in column A= MUSIC then average the cells of the same row in
column I.

I've been playing with the SUMIF and AVERAGE functions but haven't been able
to figure it out.

It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.

Any help is greatly appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj
 
Posts: n/a
Default If/Then calculate the average

have you tried
=sumif(A2:A399,"MUSIC",I2:I399)/countif(A2:A399,"MUSIC")

"LynnJ" wrote:

I'm trying to find a formula that will calculate the average number of days
it takes for a certain type of material to move through my department. Where
column A is the type of material on a book truck and column I is the number
of days it took for that book truck to move through the department.

If the cells in column A= MUSIC then average the cells of the same row in
column I.

I've been playing with the SUMIF and AVERAGE functions but haven't been able
to figure it out.

It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.

Any help is greatly appreciated.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default If/Then calculate the average

Just a slight issue with your formula:

=AVERAGE(IF(A2:A399="MUSIC",I2:I399,""))

Enter it as an array formula


"LynnJ" wrote:

I'm trying to find a formula that will calculate the average number of days
it takes for a certain type of material to move through my department. Where
column A is the type of material on a book truck and column I is the number
of days it took for that book truck to move through the department.

If the cells in column A= MUSIC then average the cells of the same row in
column I.

I've been playing with the SUMIF and AVERAGE functions but haven't been able
to figure it out.

It didn't like =AVERAGE(IF(A2:A399,"MUSIC",I2:I399)) as an array formula.

Any help is greatly appreciated.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default If/Then calculate the average

Luckily, others were wider awake than I was, and spotted the "," in
place of the "=" in your array formula.

--
Regards

Roger Govier


Roger Govier wrote
Hi Lynn
I can't see whay that array formula wouldn't work, unless there is
something wrong with the data.
You could try
=SUMPRODUCT(--(A2:A399="MUSIC"),--(I2:I339))/COUNTIF(A2:A339,"MUSIC")






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
How to calculate average from large dataset in several sheets? Orf Excel Worksheet Functions 2 December 12th 05 10:59 AM
Calculate the average using the Lookup function or similar Lars F Excel Discussion (Misc queries) 2 November 22nd 05 11:40 AM
calculate average in percentage coloumn with #DIV/! (ignore error neelsels SA Excel Discussion (Misc queries) 2 September 6th 05 02:10 PM
calculate average hours and minutes llstephens Excel Worksheet Functions 4 November 30th 04 03:47 PM
calculate average hours worked llstephens Excel Worksheet Functions 1 November 24th 04 02:37 PM


All times are GMT +1. The time now is 03:39 AM.

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

About Us

"It's about Microsoft Excel"