Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Complex SUMIF/COUNT IF

This forum is great. Thanks to those who have helped me in the past.

I am looking for formula help.

I have a list of "Names" in Cells A1:A5 (e.g. A1=John, A2=Jane, A3=John,
A4=Fred, A5=John).

In Column B, I have a list of numbers in Cells B1:B5 (e.g.
B1=2,B2=2,B3=3,B4=4,B5=5,...).

I would like to set up a formula in Column C where I can take an average of
criteria I set in Column A. For example, suppose I choose "John" and "Jane".
My formula result should be 3 ((2+2+3+5)/4). Is there a formula for this? I
have used the formula below succesfully (note, it's an array formula and I
need it to ignore blank cells), but once multiple arguments are inserted, the
formula breaks down.

=(((SUMIF(a1:a5,"john",b1:b5)))/COUNT(IF(a1:a5="john",b1:b5)))

Help would be great. Thanks again!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Complex SUMIF/COUNT IF

One way

In C1, array-enter* to confirm the formula:
=AVERAGE(IF(ISNUMBER(MATCH(A1:A5,{"John";"Jane"},0 )),B1:B5))
*press CTRL+SHIFT+ENTER

Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Evan" wrote:
This forum is great. Thanks to those who have helped me in the past.

I am looking for formula help.

I have a list of "Names" in Cells A1:A5 (e.g. A1=John, A2=Jane, A3=John,
A4=Fred, A5=John).

In Column B, I have a list of numbers in Cells B1:B5 (e.g.
B1=2,B2=2,B3=3,B4=4,B5=5,...).

I would like to set up a formula in Column C where I can take an average of
criteria I set in Column A. For example, suppose I choose "John" and "Jane".
My formula result should be 3 ((2+2+3+5)/4). Is there a formula for this? I
have used the formula below succesfully (note, it's an array formula and I
need it to ignore blank cells), but once multiple arguments are inserted, the
formula breaks down.

=(((SUMIF(a1:a5,"john",b1:b5)))/COUNT(IF(a1:a5="john",b1:b5)))

Help would be great. Thanks again!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Complex SUMIF/COUNT IF

Max -- Thanks so much. This works except if there's a blank cell in the
range it won't ignore it. How can I tewak it?

"Max" wrote:

One way

In C1, array-enter* to confirm the formula:
=AVERAGE(IF(ISNUMBER(MATCH(A1:A5,{"John";"Jane"},0 )),B1:B5))
*press CTRL+SHIFT+ENTER

Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Evan" wrote:
This forum is great. Thanks to those who have helped me in the past.

I am looking for formula help.

I have a list of "Names" in Cells A1:A5 (e.g. A1=John, A2=Jane, A3=John,
A4=Fred, A5=John).

In Column B, I have a list of numbers in Cells B1:B5 (e.g.
B1=2,B2=2,B3=3,B4=4,B5=5,...).

I would like to set up a formula in Column C where I can take an average of
criteria I set in Column A. For example, suppose I choose "John" and "Jane".
My formula result should be 3 ((2+2+3+5)/4). Is there a formula for this? I
have used the formula below succesfully (note, it's an array formula and I
need it to ignore blank cells), but once multiple arguments are inserted, the
formula breaks down.

=(((SUMIF(a1:a5,"john",b1:b5)))/COUNT(IF(a1:a5="john",b1:b5)))

Help would be great. Thanks again!!

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Complex SUMIF/COUNT IF

"Evan" wrote:
Max -- Thanks so much. This works except if there's a blank cell in the
range it won't ignore it. How can I tweak it?


Try, array-entered (CSE) as befo
=AVERAGE(IF((ISNUMBER(MATCH(A1:A5,{"John";"Jane"}, 0)))*(B1:B5<""),B1:B5))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Complex SUMIF/COUNT IF

Thanks Max. Really appreciate it

"Max" wrote:

"Evan" wrote:
Max -- Thanks so much. This works except if there's a blank cell in the
range it won't ignore it. How can I tweak it?


Try, array-entered (CSE) as befo
=AVERAGE(IF((ISNUMBER(MATCH(A1:A5,{"John";"Jane"}, 0)))*(B1:B5<""),B1:B5))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #6   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Complex SUMIF/COUNT IF

welcome, Evan. The feedback is appreciated.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Evan" wrote in message
...
Thanks Max. Really appreciate it



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
Complex SUMIF Evan Excel Discussion (Misc queries) 4 October 18th 07 11:20 PM
Complex SUMIF question SkyGuy50 Excel Worksheet Functions 4 August 8th 07 01:08 PM
How to use complex criteria in SUMIF() jjh64miles Excel Worksheet Functions 3 May 18th 06 09:08 AM
Can I use more complex logical expression for sumif as creteria? xwenx Excel Worksheet Functions 7 April 28th 06 12:53 AM
SumIf formula with complex criteria robot New Users to Excel 6 September 2nd 05 10:03 AM


All times are GMT +1. The time now is 10:25 PM.

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"