Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Combine Sumif and Countif

I need to combine sumif and countif. I am trying to add up data in a an area
say D1:O256 if it matches a criteria. Thats easy. Sumif. Then I want to
divide that number and find the average of the sum. So I would sumif to get
the total and sumifcountif the same area if the cell is greater than 1. Kinda
confusing. Basic example below but I need to to be sum if and an additional
"if" in countif. So the countif needs to be if it matches the requirements
from the sumif. Need some help here. Probably an easy fix. Just lost

=(SUMIF(QA!C3:O252,A3,QA!D3:O252))/(COUNTIF(D3:O3,"1"))
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Combine Sumif and Countif

Try this array* formula:

=AVERAGE(IF((QA!C3:O252=A3),QA!C3:O252))

The ranges in your description vary, so I've assumed that you mean
C3:O252.

I'm not sure why your COUNTIF needs to be greater than 1 - is this
another condition, or did you mean <0 ? AVERAGE does not count cells
which contain zero.

*An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual <enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
need to amend the formula you must use CSE again to commit it.

Hope this helps.

Pete

On Feb 4, 1:07*am, John wrote:
I need to combine sumif and countif. I am trying to add up data in a an area
say D1:O256 if it matches a criteria. Thats easy. Sumif. Then I want to
divide that number and find the average of the sum. So I would sumif to get
the total and sumifcountif the same area if the cell is greater than 1. Kinda
confusing. Basic example below but I need to to be sum if and an additional
"if" in countif. So the countif needs to be if it matches the requirements
from the sumif. Need some help here. Probably an easy fix. Just lost

=(SUMIF(QA!C3:O252,A3,QA!D3:O252))/(COUNTIF(D3:O3,"1"))


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Combine Sumif and Countif

I am trying to average data if it matches a criteria and if its greater than 1.


A B C

Team 95 86
Group 87 76
Example 81 99
Help 15 0
Team 86 94


What I want to do is add up all of the numbers from columns B and C if they
match a requirement from column A. So it would be like
"SUMIF(QA!C3:O252,A3,QA!D3:O252)". That includes the actual data set I want
to count and criteria. This part is easy. Next I want to divide that total to
find the average but only if the cell again matches a criteria and is greater
than 1. So it would be similar to a countif with multiple "IFs". If it
matches "A3" and its great than 1. The goal is find the average score for a
team. So in the example above I want the average for "Team."


My actual data set is QA!C3:O252. Column "C" is the column with team names
in it. The other columns contain either values or "0". Hopefully someone can
solve my issue. Thanks All

"Pete_UK" wrote:

Try this array* formula:

=AVERAGE(IF((QA!C3:O252=A3),QA!C3:O252))

The ranges in your description vary, so I've assumed that you mean
C3:O252.

I'm not sure why your COUNTIF needs to be greater than 1 - is this
another condition, or did you mean <0 ? AVERAGE does not count cells
which contain zero.

*An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual <enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
need to amend the formula you must use CSE again to commit it.

Hope this helps.

Pete

On Feb 4, 1:07 am, John wrote:
I need to combine sumif and countif. I am trying to add up data in a an area
say D1:O256 if it matches a criteria. Thats easy. Sumif. Then I want to
divide that number and find the average of the sum. So I would sumif to get
the total and sumifcountif the same area if the cell is greater than 1. Kinda
confusing. Basic example below but I need to to be sum if and an additional
"if" in countif. So the countif needs to be if it matches the requirements
from the sumif. Need some help here. Probably an easy fix. Just lost

=(SUMIF(QA!C3:O252,A3,QA!D3:O252))/(COUNTIF(D3:O3,"1"))


.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Combine Sumif and Countif

hi
there doesn't seem to be anything wrong with your structure. i have use this
structure before and it works. the only odd think i noticed was that the
sumif is summing data on sheet QA where the criteria is on current sheet. and
the countif data is also on the current sheet. was this deliberate?

regards
FST1

"John" wrote:

I need to combine sumif and countif. I am trying to add up data in a an area
say D1:O256 if it matches a criteria. Thats easy. Sumif. Then I want to
divide that number and find the average of the sum. So I would sumif to get
the total and sumifcountif the same area if the cell is greater than 1. Kinda
confusing. Basic example below but I need to to be sum if and an additional
"if" in countif. So the countif needs to be if it matches the requirements
from the sumif. Need some help here. Probably an easy fix. Just lost

=(SUMIF(QA!C3:O252,A3,QA!D3:O252))/(COUNTIF(D3:O3,"1"))

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 combine an AND and a COUNTIF Michael T Charts and Charting in Excel 4 February 1st 09 12:29 PM
Can I combine CountIf with IF or AND? Gmolatore Excel Discussion (Misc queries) 5 April 24th 08 03:55 AM
Help - I need to combine both a SUMIF and COUNTIF into one formula Natty Excel Worksheet Functions 7 April 4th 07 06:02 PM
Do I need to combine hlookup and countif????? sharkh Excel Worksheet Functions 2 August 17th 06 05:05 PM
Combine Sumif moglione1 Excel Discussion (Misc queries) 1 July 18th 06 01:46 PM


All times are GMT +1. The time now is 10:31 AM.

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"