Question: I have the following excel table:

```
StartDate  YTDActual
1/1/2013   100
2/1/2013   200
3/1/2013   99
4/1/2013   33
5/1/2013   45
6/1/2013   0
7/1/2013   0

```

Is there a formula that returns, for each StartDate, the associated value in YTDActual, if it is different than 0, otherwise it would return the last YTDActual value different than 0 in the previous rows.

So, basically the formula would produce the following values in the NewValue column:

```
StartDate  NewValue
1/1/2013   100
2/1/2013   200
3/1/2013   99
4/1/2013   33
5/1/2013   45
6/1/2013   45
7/1/2013   45

```

Note that in Jun & Jul the values are 45 because May had the last non-zero YTDActual value 45.

Thanks

Update: Just a clarification, the second table goes onto another sheet, they are not side by side.

Answer: 
This would do it:

```
Col A      Col B        Col C
StartDate  YTDActual    NewValue
1/1/2013   100          =if(B2<>0,B2,C1)
...

```

Then just drag down the formula in Column C
Is the new data going in a column next to YTDActual? What I am getting at here is does it need to reference the date or could it just be a column C with:

```
=if(B2=0,C1,B2)

```

This would return B2 if not zero or otherwise the cell above it, this could be entered in cell C2 then dragged down to cover the other cells.

If this does not work to have the new data in the columns next to column B above then I think you may struggle to do this without VBA. The problem that you will have is that you cannot create loops, so if a value is zero, you can check for another value, but this may also be zero and so on.