Tib
Tib

Reputation: 2631

SUMIF of absolute values

I have a spreadsheet with values like that:

A          | B
10,55 €    | x
10,05 €    | 
-0,55 €    | x
7,55 €     | 
-88,50 €   | x

I want the absolute sum of all rows with x in B

I can get the sum of x rows with =SUMIF(B2:B100; "x"; A2:A100)

And the absolute sum of all A column with =SUMPRODUCT(ABS(A2:A100))

But I don't know how to mix those 2 formulas

Upvotes: 4

Views: 3808

Answers (2)

TheMaster
TheMaster

Reputation: 50462

=SUMPRODUCT(IF(B2:B100="x",ABS(A2:A100)))

Upvotes: 4

WNG
WNG

Reputation: 3805

you can use an ArrayFormula in Google docs :

=ArrayFormula(SUM(IF(B2:B100="x",ABS(A2:A100),0)))

Upvotes: 3

Related Questions