Merge 2 rows together - with IF/THEN rules and visual - Scenario 1

ChrisOK

Well-known Member
Joined
Mar 26, 2003
Messages
601
Need help putting together merging code for the following scenario holding a Code 1 in the top row and a Code 2 in the bottom row of Col A.

A..........B..........C.........D...........E...............F............G............H.............I..............
Code...NSN#.....Desc.....Other1.....Other2.....SRAN.........Other3....Loc.........City............
===================================================================
1........4545.....Bolt......[.........]....shelf 95...FB22..........xx299......Calf.....[................]..
2........4545.....Bolt.......0.25mm....shelf 15...FB22..........xx299.......NYC....[................]..
x........4545......xxx.......xxxxxxx.....xxxxxx....NO SRAN....xxxxxx......xxxx......Los Angeles...

Had trouble trying to get an image to show up using the <img> and tags so, resorting to the old-fashioned visual.

<u>Here's the set of rules I must use to merge the data from the BOTTOM ROW into the TOP ROW.</u>

<b><u>SCENARIO # 1:</b></u>
<b>DO THE NSNs MATCH? </b>
<b>YES,</b> use the bottom row to update the top row.
Begin updating/merging data with COLUMN D,
Continue merge comparisons for the following columns: E,I,J,K,L,M,N,O,P,Q,S,T,U,V,W,X,Y,Z,AA,AB, and so on thru AQ.

....If data in top row is blank THEN populate top row from the bottom row.********

....If data in top row is populated but different THEN populate top row from the bottom row.*****

....If data in top row is populated and the same THEN populate top row from the bottom row.*****

....If data in both the top and bottom rows are blank, look to see if a "NO SRAN" row exists and use THAT row to populate top row.

Turn the newly merged top row orange.

Change all font to black.

Place a "C" to the right of the code that exists in Column A. Example, Code 1 will become "1C" or if Code 2, it will become "2C".
(this indicates the data was updated/changed and is acceptable for use.

<b>Move to the next available row and re-start comparison process from beginning .</b>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<b>If a "NO SRAN" row does NOT exist,</b> select the bottom row, cut and paste this bottom row onto another sheet called "Archive".

Turn the newly merged top row orange.

Change all font to black.

Place a "C" to the right of the code that exists in Column A. Example, Code 1 will become "1C" or if Code 2, it will become "2C".
(this indicates the data was updated/changed and is acceptable for use.

Move to the next available row and re-start comparison process from beginning .
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<i><b>Notice how the blank areas on the top row will be populated using the bottom row (if available)</i></b>
<i><b>If both the top row AND bottom row are blank, the code will attempt to locate a "NO SRAN" row and use THAT row's data to populate the top row.</i></b>
(Los Angeles) in this case would be copied up into the top row to ensure it was all inclusive of as much data as possible.
(0.25 mm) in Column D would get copied up into the top row since it was available for merging.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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