5

I currently have the exact function set up here: Summing a column, filtered based on another column in Google Spreadsheet

The number I'm getting from the query is almost always negative (a list of transactions) so if it's more than zero, I want it to default to zero.

This is what I currently have and it's returning the zero as I'd like but not if the result of the query is #N/A

=MIN( SUM(FILTER( TRANSACTIONS! C4:C51; TRANSACTIONS! D4:D51="Other")) , 0)
5

Answering my own question. IFERROR is what I needed to use.

=IFERROR(MIN(SUM(FILTER(TRANSACTIONS! C4:C51; TRANSACTIONS! D4:D51="Other"))) ,0)
1

I always use the ISNA() function. As a first step, I create the range with filter():

=FILTER( TRANSACTIONS! C4:C51; TRANSACTIONS! D4:D51="Other");

As a second step, I always use the:

=IF(ISNA(range);0;thingsToDoWith(range));

So, in your case it will become:

=IF(ISNA(FILTER( TRANSACTIONS! C4:C51; TRANSACTIONS! D4:D51="Other"));0;SUM(FILTER( TRANSACTIONS! C4:C51; TRANSACTIONS! D4:D51="Other")));

It’s pretty handy, if you get used to it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.