Google 具有多个条件的工作表 averageif

Google Sheets averageif with multiple criteria

寻找一个公式来计算位于 'Salary' 列中的数字的平均值,只要一行中的任何优先级列以任意顺序同时包含 'Car' 和 'House',所以这个。

Name Priority Priority Priority Salary Average Salary of Car/Home owners
John House Car Loans 40,000
Ned House Groceries Car 120,000
Dom Family Car Going Fast 450,000
Thanos Stones Balance House 9,000,000
Homer Donuts Car House 20,000

可能会变成

Name Priority Priority Priority Salary Average Salary of Car/Home owners
John House Car Loans 40,000 60,000
Ned House Groceries Car 120,000
Dom Family Car Going Fast 450,000
Thanos Stones Balance House 9,000,000
Homer Donuts Car House 20,000

平均工资列将仅用于第 1 行中的公式。

一个选项可以是:

=ArrayFormula(AVERAGEIF(MMULT((B2:D="house")+(B2:D="car"),ROW(A1:A3)^0),2,E2:E))

我能想到的最简单的方法是:

=SUMPRODUCT(REGEXMATCH(B2:B&C2:C&D2:D,"House|Car"),E2:E)