Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Conditional Average

How can I use a formula to average values in rows which have a certain
value in another column of that same row?

For example, I want to average the values in Col A if Col D = "A":

A B C D
1 12 1234 1234 A
2 11 1232 1654 A
3 40 2312 5435 B


This is what I tried (entered as an array with CTRL-SHIFT-ENTER), but
I get a #VALUE error:
=AVERAGE(IF(D2:D5000="A",A2:A5000,""))

The answer I'd be looking for is 11.5.

Any ideas?

Thanks.

John

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Conditional Average

The average won't work with empty cells or zeros. Your range extends beyond
the data.

--
Anything is possible if you do not know what you are talking about.


" wrote:

How can I use a formula to average values in rows which have a certain
value in another column of that same row?

For example, I want to average the values in Col A if Col D = "A":

A B C D
1 12 1234 1234 A
2 11 1232 1654 A
3 40 2312 5435 B


This is what I tried (entered as an array with CTRL-SHIFT-ENTER), but
I get a #VALUE error:
=AVERAGE(IF(D2:D5000="A",A2:A5000,""))

The answer I'd be looking for is 11.5.

Any ideas?

Thanks.

John


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Conditional Average

I'm not sure that's correct. AVERAGE works fine on my XL with empty cells,
whether entered as an array or otherwise.

Are the numbers formatted as numbers or text?

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Wood Grafing" wrote:

The average won't work with empty cells or zeros. Your range extends beyond
the data.

--
Anything is possible if you do not know what you are talking about.


" wrote:

How can I use a formula to average values in rows which have a certain
value in another column of that same row?

For example, I want to average the values in Col A if Col D = "A":

A B C D
1 12 1234 1234 A
2 11 1232 1654 A
3 40 2312 5435 B


This is what I tried (entered as an array with CTRL-SHIFT-ENTER), but
I get a #VALUE error:
=AVERAGE(IF(D2:D5000="A",A2:A5000,""))

The answer I'd be looking for is 11.5.

Any ideas?

Thanks.

John


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Conditional Average

Works fine if you properly array enter it.

--
HTH

Bob

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

wrote in message
oups.com...
How can I use a formula to average values in rows which have a certain
value in another column of that same row?

For example, I want to average the values in Col A if Col D = "A":

A B C D
1 12 1234 1234 A
2 11 1232 1654 A
3 40 2312 5435 B


This is what I tried (entered as an array with CTRL-SHIFT-ENTER), but
I get a #VALUE error:
=AVERAGE(IF(D2:D5000="A",A2:A5000,""))

The answer I'd be looking for is 11.5.

Any ideas?

Thanks.

John



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Conditional Average

I took the "" out of the false part of the IF statement and it is now
working. If I don't enter as an array, I just get a 0.

Is the formula I used the best way to do this? Any way to do it
without an array?

Thanks.

John



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
Conditional Average Jason Excel Worksheet Functions 5 August 3rd 06 01:51 PM
Conditional Average MEK911 Excel Discussion (Misc queries) 4 September 9th 05 05:45 PM
Conditional Average MEK911 Excel Worksheet Functions 4 September 9th 05 05:23 PM
Conditional Average Kstalker Excel Worksheet Functions 4 August 22nd 05 03:28 AM
Conditional average function Andres Excel Worksheet Functions 1 August 9th 05 06:31 PM


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