Match data in source and target then copy to sheet

honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
Hi

I need to transfer quote a lot of data from one worksheet to another. The data I need is all in column L, but I need to first check the following:

A in the target sheet needs to match B in the source - this is simply a date in dd/mm/yyyy format
AA in the target sheet needs to match I in the source - this is just text...a name

If those two things are correct, then the data in L should be the result in the target sheet

I did have some code for doing this ages ago and just found it tucked away in an email draft. It uses INT in it, which may have indicated that the date cell at the time had both date and time. That is not the case in either source or target, so this code has not worked for me. I guess it is a starting point, so here it is:

VBA Code:
=IF(ISERROR(MATCH(1,INDEX((INT('monthly_tho_bsp_2020-01-01.csv’!B$2:B$20000)=A2)*('monthly_tho_bsp_2020-01-01.csv’!I$2:I$20000=AA2),),0)),"",INDEX('monthly_tho_bsp_2020-01-01.csv’!L$2:L$20000,MATCH(1,INDEX((INT('monthly_tho_bsp_2020-01-01.csv’!B$2:B$20000)=A2)*('monthly_tho_bsp_2020-01-01.csv’!I$2:I$20000=AA2),),0)))

Any suggestion on how to have this work correctly to firstly compare the data in the source and target in the above columns and if they match, the copy the required data in column L to the target?

Regards
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,671
Messages
6,126,131
Members
449,293
Latest member
yallaire64

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