I am trying to sum values from 3 different columns when there is a change in the values

I came up with this IF formulas :

```
=IF(AND((B2-A2)=0,(C2-B2)=0),0, SUM(B2:C2))
```

The formulas work when the value of `(C2-B2) > 0`

2
However, it doesn't take into account the change when `(B2-A2)> 0`

3
what argument should I add for my formula ? thank you !