I'd like to calculate the average spending on given categories but not all. I use AVERAGEIFS for this. But it doesn't  seem to work.My sheet (just relevant columns):  B  |   DSpent|Category-----|---------10   |Category111   |Category19    |Category630   |Category322   |Category415   |Category5I have this formula:=AVERAGEIFS(B2:B;D2:D;Category1;D2:D;Category2;D2:D;Category3;D2:D;Category4;D2:D;Category5)And it always gives me #DIV/0! Even when I have at least one value in all category. Based on the documentation I doing this right or I fail to see the error in my ways.
Google Spreadsheet AVERAGEIFS divides with 0
google spreadsheets
Like @pnuts said in his comment, all AVERAGEIFS criteria must match. You seem to need all these values where one or more of the criteria is matching. This formula should give you what you want:=AVERAGE(FILTER(B2:B,MATCH(D2:D, {Category1,Category2,Category4}, 0)))