Excel averageifs with or function

后端 未结 3 1977
花落未央
花落未央 2021-01-13 01:46

I am using the averageifs function, and have one column where I need to calculate the average if either of the criteria are true.

I have tried using the OR function,

3条回答
  •  不知归路
    2021-01-13 02:12

    AVERAGEIFS extra criteria is a boolean AND operator, it can't perform OR operations. But since your columns do not change we can somewhat implement this ourselves:

    Here is a simple way using an array formula (entered with ctrl + shift + enter):

    =AVERAGE(IF((I1:I612="IF")+(I1:I612="FL"),N1:N612))
    

    Or if you don't like using array formulas you basically do this manually using SUMPRODUCT and COUNTIF:

    =SUMPRODUCT((I1:I612="IF")*(N1:N612)+(I1:I612="FL")*(N1:N612))/(COUNTIF(I1:I612,"IF")+COUNTIF(I1:I612,"FL"))
    

提交回复
热议问题