How to copy a range of data if two cells match

rockychelsea

New Member
Joined
Jul 30, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
In Sheet 1, column C i have a list of employee codes

One Sheet 2, column A i have a list of employee codes

I would like to copy data from Sheet 2, columns B,C,D,E & F to Sheet 1 columns K,L,M,N & O only if employee codes match in column in Sheet 1, column C and Sheet 2 column A

If no match is found, there is no data that needs to be copied from sheet 2 to sheet 1

Help is greatly appreciate :)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi, welcome to the forum.

Perhaps a simple formula like this would help you :

Book1
ABCDEFGHIJKLMNO
1Codedatacopy
21234blah1clah2dlah3elah4flah5
31235blah1clah2dlah3elah4flah5
41236blah1clah2dlah3elah4flah5
51237blah1clah2dlah3elah4flah5
61238blah1clah2dlah3elah4flah5
71239blah1clah2dlah3elah4flah5
81240blah1clah2dlah3elah4flah5
91355 
101241blah1clah2dlah3elah4flah5
11
12
13
14
15
16
17Assuming Data in Sheet2 looks like this :
18Codedata1data2data3data4data5
191234blah1clah2dlah3elah4flah5
201235blah1clah2dlah3elah4flah5
211236blah1clah2dlah3elah4flah5
221237blah1clah2dlah3elah4flah5
231238blah1clah2dlah3elah4flah5
241239blah1clah2dlah3elah4flah5
251240blah1clah2dlah3elah4flah5
261354blah1clah2dlah3elah4flah5
271241blah1clah2dlah3elah4flah5
28
Sheet1
Cell Formulas
RangeFormula
K10:O10,K9,K2:O8K2=XLOOKUP(C2,Sheet2!A2:A50,Sheet2!B2:F50,"")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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