Hacker News new | ask | show | jobs
by Someone 1382 days ago
I wish they completed the IF variants of statistical functions.

Why do we have AVERAGEIF, but not AVERAGEAIF or GEOMEANIF, MAX and MAXIFS, but not MAXIF, etc?

I can’t find logic in that.

(https://support.microsoft.com/en-us/office/excel-functions-b...)

Ideally, the “IF” would be a separate function that filters out cells, so that it could be used with VBA functions taking multiple cells, too.

While at it, these IF functions should use lambdas for specifying the criteria instead of strings such as “>5”

1 comments

That doesn’t do what the FooIF functions do: take a range, evaluate a user specified function on each of its cells, and then call Foo on the cells for which the function returns true.

Yes, you can create new cells that compute the Boolean, then use IF to populate a new range with the values that pass the test, and then call Foo on the new range, but avoiding such ‘pollution’ of spreadsheets is the whole reason these functions exist.