I have the following data set.
I have the following data set. As you see some of the values in column A, B, D, and R are missing. I am going to replace the values with exact values from previous rows. for example, in row 4, the value for column B and R are missing, and I need to replace them with 21 and 2 from pervious column.
A B D R sentence ADR1 ADR2
135 21 EffexorXR.21 1 lack of good feeling. good feeling
0 0
136 21 EffexorXR.21 2 Feel disconnected disconnected feel
136 EffexorXR.21 0 0
142 22 EffexorXR.22 1 Weight gain gain
142 1 1
The final out put is like this:
A B D R sentence ADR1 ADR2
135 21 EffexorXR.21 1 lack of good feeling. good feeling
135 21 EffexorXR.21 1 1 0
136 21 EffexorXR.21 2 Feel disconnected disconnected feel
136 21 EffexorXR.21 2 0 0
142 22 EffexorXR.22 1 Weight gain gain
142 22 EffexorXR.22 1 1
I can use copy, but I do not know how to iterate between rows. Any suggestion ?