I have an Excel table like this and want to get RESULT(subtracting row numbers of cells which contain 1). I have thousands of rows so I need a formula.

```
ROW NMB Value RESULT
1 0
2 1 2-1=1
3 0
4 0
5 0
6 1 6-2=4
7 0
8 0
9 1 9-6=3
```

`=IF(B2>0,A2-B2,"")`

? – Máté Juhász Jan 14 at 18:19`=IF(C4>0,A4-SUM(D$1:D3),"")`

you are looking for. – cybernetic.nomad Jan 14 at 18:39