I'm trying to calculate the average of a filtered list (J23:J1026), but with a condition.
The condition is to calculate the average of the values < 0.
I was able to get the count of the values < 0 with the following formula in cell D19:
=SUMPRODUCT(SUBTOTAL(3;OFFSET(J23;ROW(J23:J1026)-ROW(J23);0));(J23:J1026<0)+0)
But I am not able to calculate the average of the values < 0.
The result should update if the list is filtered in another column.
Does anybody know what I am missing?
Thank you very much in advance!


Edit: Formula suggested is related with
ExcelTags which was earlier posted in OP(Original Post - Please see edits of the post), however OP(Original Poster) later changed the tags.Try using
MAP()function withSUBTOTAL()Not sure about
Libre Office Calcas per OP sinceLET(),MAP()andLAMBDA()are not available functions of the same, hence could try this way as well:Since I am not familiar with
Libre Office Calchence as per the comments of OP, I am borrowing the idea that the given formula in above will work when it is committed with CTRL+SHIFT+ENTER