Excel 2013 PowerPivot Calculated Column question

john234

New Member
Joined
Aug 1, 2015
Messages
1
I am trying to create a calculated column in a single table Power Pivot file using a conditional IF expression.

My first column only contains random recurring values of 5,9 and 0. My goal for the new calculated column is to replace the instances of 0 with the last prior row's instance of either a 5 or a 9 (see visual below).

Column1data New Calculated Column2Desired Result

9 9
0 9
0 9
5 5
9 9
0 9
0 9
5 5
0 5
0 5
5 5


Any suggestions on a calculated column formula on how to accomplish this seemingly simple task?

I assume I may have to use an index column, or look up function? My first draft of the calculated column is:

=if([Column1data]=5,5,IF([Column1data]=9,9,?previous non zero value in [Column1data]?))
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,115
Messages
6,176,466
Members
452,728
Latest member
mihael546

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