Fill cells based on historical data

mirmad

New Member
Joined
Nov 11, 2015
Messages
12
Hello,
once again me with a specific problem that I am not able to solve yet. Not sure if this can be tackled easily, I searched the net for some solutions and tried myself using my limited knowledge, but no luck so far. I will appreciate anyone's helps on this.

I have a table with A-M columns that receives new rows every day (tables added at the end). New rows contain only data in columns A-M, old rows contain also data in columns N-P.
I need to automatically add cells in columns N-P to a new row if value in M exists in any of the previous rows. Those values should be the same as the first entry found in the rows above.
If such entry is not found then cells N,O,P should be inserted with 'n/a'
In example
A1
A2A3A4A5A6A7A8A9A10A11
A12
A13
A131
A242
A353
B2
B2
B3
B4
B5
B6
B7
B8
B9
B10
B11
B12
B13
XXX
YYY
TTT
C3
C2
C3
C4
C5
C6
C7
C8
C9
C10
C11
C12
A13
A121
A232
A343
D4
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
A131
YYY
EEE
E5
E2
E3
E4
E5
E6
E7
E8
E9
E10
E11
E12
E13
6a
a
a
a
a
a
a
a
a
a
a
a
A13
A121
A232
A343
7b
x
x
x
x
x
x
x
x
x
x
B13
XXX
YYY
TTT
8c
f
g
g
fs
g
da
C13
n/a
n/a
n/a
9d
DDD
FW
FS
FE
FR
FT
FZ
E13
10e
ds
gr
ht
jz
ku
vd
gr
ht
sw
ce
ge
D13
A131
YYY
EEE

<tbody>
</tbody>

First five rows are the old records - the cells N to P are filled up already or not filled up.
Second five rows are added to the sheet, depending on the value in column M the cells to the right (N,O,P) should be filled, based on the first finding above with the same value in column M.
That results in:
Row 6 has A13 in the column M. First cell with same value above the current(new) row is in 3rd row - cells N,O,P from third row therefore get copied and inserted into row 6
Row 7 has B13 in the column M. First cell with same value above the current(new) row is in 2rd row - cells N,O,P from third row therefore get copied and inserted into row 7
Row 8 has C13 in the column M. There is not a cell with this value in the rows above, so 'n/a' is inserted in the cells N,O,P
Row 9 has E13 in the column M. First cell with same value above the current(new) row is in 5th row - it contains nothing in cells N,O,P, therefore row 9 shall also contain nothing in cells N,O,P
Row 10 has D13 in the column M. First cell with same value above the current(new) row is in 4th row - cells N,O,P from 4th row therefore get copied and inserted into row 10

I see that the problem may be how to recognize the old rows - if that is so I can replace blank N,O,P cells with any string to mark old rows as the ones where N,O,P contains something.

Has anyone experience with such methods of filling up cells?

many thanks in advance for anyones help.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
See if this, copied across and down is any use to you.

Excel Workbook
ABCDEFGHIJKLMNOP
1A1A2A3A4A5A6A7A8A9A10A11A12A13A131A242A353
2B2B2B3B4B5B6B7B8B9B10B11B12B13XXXYYYTTT
3C3C2C3C4C5C6C7C8C9C10C11C12A13A121A232A343
4D4D2D3D4D5D6D7D8D9D10D11D12D13A131YYYEEE
5E5E2E3E4E5E6E7E8E9E10E11E12E13
66aaaaaaaaaaaaA13A121A232A343
77bxxxxxxxxxxB13XXXYYYTTT
88cfggfsgdaC13n/an/an/a
99dDDDFWFSFEFRFTFZE13
1010edsgrhtjzkuvdgrhtswcegeD13A131YYYEEE
Fill Cells
 
Upvote 0
Peter, you are the best. This was really easy for you while so complicated for me:), the formula works exactly as I wanted, thanks again and have a great day!:)
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,301
Members
449,095
Latest member
Chestertim

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