Match data in source and target then copy to sheet

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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