LibreOffice Calc: SUMIFS based on each row condition
Matthew Barrera
Assume I have the following data:
I want to do a calculation based on each currency and amount. Something like:
So money in (for USD) will be the sum of column H where the amount is positive, and the currency is USD. Money out (for USD) will be the sum of column H where the amount is negative, and the currency is USD.
How to calculate this? I'm thinking of using SUMIFS, but I always get Err:502. My formula is :
=SUMIFS($H$2:$H$65440, G2, "USD", H2, ">0")
1 Answer
From the official Libreoffice documentation
Func_Range and Range1, Range2... must have the same size, otherwise the function returns err:502 - Invalid argument.
So you must use ranges in your conditions, and your formula should be
=SUMIFS($H$2:$H$65440, $G$2:$G$65440, "USD", $H$2:$H$65440, ">0")