Replace Zeros with the most recent value.

mescalante48

New Member
Joined
Sep 15, 2021
Messages
29
Office Version
  1. 2007
Platform
  1. Windows
Hello everyone,

Please see the example below.
what would be the formula in C1 so to return the most recent non Zero value of column B until a new value appears.

the input is column B, the goal is column C

No arrays and no VBA, since this is for Sierra Chart.

Any comment will help.

959099639fbd8c739d055a783c2bac7d.png

Gyazo
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
In C1 and fill down
Excel Formula:
=IF(B1=0,C2,B1)
 
Upvote 0
Solution
For that you will need to insert an empty row above, the data must start in row 2 with row 1 being empty.
In B2 and fill down
Excel Formula:
=IF(A2=0,B1,A2)
 
Upvote 0

Forum statistics

Threads
1,223,355
Messages
6,171,610
Members
452,411
Latest member
sprichwort

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top