Reputation: 341
I have a table like this with two columns (A
and B
) - the first column contains times, the second column contains "checkboxes":
12:00:00 x
10:00:00
13:00:00 x
I want to SUM up all times with an "x" so the outcome should be 25:00:00
.
I tried with =VLOOKUP(A4;A1:B3;1;FALSE)
the key is A4=x
sadly this does not work! (x was not found)
Upvotes: 0
Views: 127
Reputation: 1
=TEXT(SUMIF(B:B, "=x", A:A), "[h]:mm:ss")
=TEXT(SUM(FILTER(A:A, B:B="x")), "[h]:mm:ss")
=ARRAYFORMULA(TEXT(SUM(IF(B:B="x", A:A, )), "[h]:mm:ss"))
=TEXT(SUM(QUERY(A:B, "select A where B ='x'")), "[h]:mm:ss")
=TEXT(SUMPRODUCT((B:B="x")*(A:A)), "[h]:mm:ss")
Upvotes: 1
Reputation: 96753
Something like:
=SUMPRODUCT((A1:A100)*(B1:B100="x"))
with the proper formatting applied.
Upvotes: 0
Reputation: 5148
SUMIF
is what you're looking for:
=SUMIF(B:B, "=x", A:A)
Where B:B
is the range to match to the condition =x
and A:A
is the range to sum when the condition is met.
Upvotes: 1