Trying to run an AVERAGEIFS function across a date variable AND either criteria 1 OR criteria 2 out of a second range. Concept is below. I've found SUMPRODUCT or array formulas to solve the OR problem, but I'm not sure how to combine the date to those solutions. Thanks!
=+IFERROR(AVERAGEIFS(AVERAGE RANGE,CRITERIA RANGE,(Criteria 1 OR Criteria 2),DATE RANGE,DATE)"")
You will need to use SUMIFS and COUNTIFS:
=IFERROR(SUMPRODUCT(SUMIFS(RANGE,CritRange,{Crit1,Crit2},DateRange,Date))/SUMPRODUCT(COUNTIFS(RANGE,CritRange,{Crit1,Crit2},DateRange,Date)),"")
Related
I'm writing a COUNTIF to count the number of rows between two columns where at least one of the cells in the row is not blank. The logic is as follows:
COUNTIF($A:$A OR $B:$B, "<>"&"")
I know I can't nest an OR within a COUNTIF, but is there something else I can do? I am familiar with using an array when you have multiple criteria, but I don't believe that works for ranges.
You need to do two COUNTIF an one COUNTIFS:
=COUNTIF(A:A,"<>")+COUNTIF(B:B,"<>")-COUNTIFS(A:A,"<>",B:B,"<>")
Or you need to limit the data range to use SUMPRODUCT:
=SUMPRODUCT(--((A1:A1000<>"")+(B1:B1000<>"")>0))
I have a SUMIFS formula below and it does not seem to be working correctly any help would be greatly appreciated.
The formula is below
=SUMIFS(C4:N4,C4:N4,C4<=11,C4:N4,F4<=1,C4:N4,I4<=1,C4:N4,L4<=1)
From the picture you can see that the result in cell R4 should read 4 but it returns a 0
Any help would be greatly appreciated.
SumIfs works with sum_range, criteria_range, criteria.
You've given it sum_range, criteria_range, criteria_cell & criteria.
Try =SUMIFS(C4:N4,C4:N4,"<=1"), or as it's only a single criteria =SUMIF(C4:N4,"<=1",C4:N4)
Edit: Just noticed - is that first criteria meant to be <=11?
If so this formula will work: =SUM(IF(C4<=11,C4,0),SUMIF(F4:N4,"<=1",F4:N4))
Using SUMIFS means that you want to add the values in C4:N4 only if all conditions are TRUE. If this is correct use this formula.
=IF(AND(C4<=11,F4<=1,I4<=1,L4<=1),SUM(C4:N4),0)
'SUMIFS' is intended for operations with ranges in which one column is added if all condition in other columns are met see WorksheetFunction.SumIfs Method . But in your case you are testing conditions in a row and if they are met you want to add the values in the row.
Tryingto CountIf with Exclusions and multiple criteria,
Here's an example of just multiple critera:
=SUM(COUNTIFS(A1:A9,"YES",B1:B9,{"JOHN","GEORGE","RINGO","PAUL"}))
Here's an example of just exlusion:
=SUM(COUNTIFS(A1:A9,"YES",B1:B9,"<>*JOHN*"))
And here's the sum we're currently got but not working:
=SUM(COUNTIFS(A1:A9,"YES",B1:B9,{"<>*JOHN*","<>*GEORGE*","<>*RINGO*","<>*PAUL*"}))
When criteria becomes too complex for COUNTIFS, you can often use an array formula. I think the following array formula will achieve your goal...
=SUM(IF(A1:A9="YES",1,0)*(IF(ISNUMBER(FIND("JOHN",B1:B9)),0,1))*(IF(ISNUMBER(FIND("GEORGE",B1:B9)),0,1))*(IF(ISNUMBER(FIND("RINGO",B1:B9)),0,1))*(IF(ISNUMBER(FIND("PAUL",B1:B9)),0,1)))
Make sure to use CTRL+SHIFT+ENTER to enter the array formula.
I am trying to use the averageifs function in excel to find the average that meets a date criteria and is below three standard deviations.
This is what I have
=averageifs(R16:R38375,R16:R38375,"<U19",P16:P38375,U16)
The P column contains the date range and U19 is the date criteria.
I have also tried array functions with no luck. Thank you in advance for the help.
You need to take the less than operator alone in the quotes and concatenate the cell reference off the right end.
=averageifs(R16:R38375, R16:R38375, "<"&U19, P16:P38375, U16)
AVERAGEIFS function
=SUMIFS($B:$B*$N:$N,$N:$N,">=5",$N:$N,"<10")
I want to multiply 2 columns and sum all instances of it, conditioned only on one of the columns.The formula gives an error because I multiply in the first argument, which just should be a single number I guess. I tried using SUMPRODUCT too, but as column B does not have a condition, it doesn't work. Can anyone advice please. Thanks in advance.
The equivalent SUMPRODUCT formula for your SUMIFS attempt is:
=SUMPRODUCT(B:B,N:N,--(N:N>=5)*(N:N<10))
But you should avoid using full column references in SUMPRODUCT. If you can't limit range sizes, consider using dynamic named ranges.
try:
=SUMPRODUCT(B:B,IF(N:N>=5,IF(N:N<10,N:N,""),""))
with array ctrl+shift+enter