This question already has an answer here:

I'd like to use array function to get conditional sum based on two columns. Given the example, for each ID I want to calculate the sum of value column if column B is -1

```
ID | B | value |
________________
A1 1 2
A2 1 3
A3 1 4
A3 -1 5
A3 -1 1
A2 1 5
A1 1 1
A2 -1 2
```

The outcome should be

```
ID | value_total |
__________________
A1 1 0
A2 1 2
A3 1 6
```

`col C`

for each unique value in`col A`

when`col B`

is`-1`

? And you want a formula, not a macro? – Raystafarian Jul 31 '13 at 13:32`*excel*`

as tag. Note the placeholders – nixda Nov 4 '13 at 20:28