Hi, I'm trying to set up an excel sheet to do some solver on.

Here is the problem:
I got a column where indicator values will be set in by solver eventually
If value is 1 the neighbouring cell will show the number on the left like thus:

07 | 0 |
10 | 1 | 10
14 | 0 |
17 | 1 | 17
14 | 0 |
17 | 0 |
21 | 1 | 21

This is not precisely what I want. I want it to show the difference between the given intervals ofnumbers like thus:

07 | 0 |
10 | 1 | 10
14 | 0 |
17 | 1 | 7
14 | 0 |
17 | 0 |
21 | 1 | 4

The solver will try to choose the indicators to set to 1 eventually, based on other criteria as well, point is that the numbers on the right have to be between 3 and 9

HOW DO I DO THIS??