Copy Adjacent Cell if Cells Match in 2 Separate Worksheets

tkoby11

New Member
Joined
Dec 18, 2021
Messages
23
Office Version
  1. 2021
Platform
  1. MacOS
Hi, between 2 spreadsheets, where column B or "Description" are the same I want to copy the adjacent cell value (Column A or "Code") from Column A in the old sheet to column A in the new sheet. The problem is that the new sheet is not all of the same data items each time so it is not a 1 for 1 sort, copy-paste job.

This is one of a few different formatted inventory sheets and the only one that has NO original "code" (yes weird and have asked source to include theirs as you would think it would be static) so I apply my own for my use each time I load it into my system. Each new sheet does not always have the same items, maybe 80% of the time. The other 20% are new and I create a new "code" which I would do manually. So since the items are not always the same I can't just sort, copy and paste. The problem with applying a new random code number each time is that if a customer places and order today and the item code is 0001, if I load a new sheet tomorrow and item 0001 has then sold out and thus 0001 gets applied to a different in stock item that got the new 0001 designation, their fulfillment/shipping notice a few days later reads the wrong new item.


For example this is just on 2 lines of data (normally 400-600 unique items)

In sheet 1, I have:

column A column B
CodeDescription
KS0001A Los Vinateros Bravos, Pipeno Blanco 2020 1L
KS0002Adrien Renoir, Le Terroir Extra Brut NV

In the new sheet, sheet 2, I want to copy the text in the column "Code" for the same row where the Description is the same:

column A column B
CodeDescription
(new random code manally generated)Adrien Renoir, Le Terroir Extra Brut NV
(I need KS0002 here)Adroît, Mourvedre 2019
 

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.
Corrected data set example:

Hi, between 2 spreadsheets, where column B or "Description" are the same I want to copy the adjacent cell value (Column A or "Code") from Column A in the old sheet to column A in the new sheet. The problem is that the new sheet is not all of the same data items each time so it is not a 1 for 1 sort, copy-paste job.

This is one of a few different formatted inventory sheets and the only one that has NO original "code" (yes weird and have asked source to include theirs as you would think it would be static) so I apply my own for my use each time I load it into my system. Each new sheet does not always have the same items, maybe 80% of the time. The other 20% are new and I create a new "code" which I would do manually. So since the items are not always the same I can't just sort, copy and paste. The problem with applying a new random code number each time is that if a customer places and order today and the item code is 0001, if I load a new sheet tomorrow and item 0001 has then sold out and thus 0001 gets applied to a different in-stock item that got the new 0001 designation, their fulfillment/shipping notice a few days later reads the wrong new item.

For example this is just on 2 lines of data (normally 400-600 unique items)

In sheet 1, I have:

column A column B
CodeDescription
KS0001A Los Vinateros Bravos, Pipeno Blanco 2020 1L
KS0002Adrien Renoir, Le Terroir Extra Brut NV

In the new sheet, sheet 2, I want to copy the text in the column "Code" for the same row where the Description is the same:

column A column B
CodeDescription
(I need KS0002 here)Adrien Renoir, Le Terroir Extra Brut NV
(new random code manally generated)Adroît, Mourvedre 2019
 
Upvote 0
Hi, I burned a few hours trying a few different formulas and ended up here as I thought this would be a great place to get help. Can someone please help me edit the first part and then delete the second post I made that is technically not a dupe as it was the correct version of the first post in this thread? I had highlighted the wrong cells in bold. Thank you in advance for any assistance! I'm a newbie so I could not make any edits or message the moderator that deleted my corrected post.

Of course a solution to the actual question in the post would be most amazing and I would be most grateful.
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,099
Members
452,379
Latest member
IainTru

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