Copy cells from specific row if the value from another cells match

saloro

New Member
Joined
Jul 31, 2019
Messages
2
Hi guys, I have a problem with my accounting data analysis. I have two workbooks, let's call them "MAIN" and "DATA". Both are exported from another program, that's why they are in separate files, although they can be on separate worhsheets if there is a need. I have to copy cells from "DATA" workbook to "MAIN", based on "Description" column. Copied values have to be from the same row where description was found. Also another difficulty is that description sometimes is not exact, but I need to find all occurrences. I tried to solve this with VLOOKUP and other formulas, the results were poor and when I tried to copy a formula by dragging the fill handle it all messed up.


"MAIN" looks like this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Date
[/TD]
[TD]Account1
[/TD]
[TD]Settlement
[/TD]
[TD]Dt
[/TD]
[TD]Ct
[/TD]
[TD]Description
[/TD]
[TD]Currency
[/TD]
[TD]Transaction type
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementX
[/TD]
[TD][/TD]
[TD]25,00
[/TD]
[TD]ABC
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementX
[/TD]
[TD]25,00
[/TD]
[TD][/TD]
[TD]DEF
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementY
[/TD]
[TD][/TD]
[TD]39,00
[/TD]
[TD]GHI
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementY
[/TD]
[TD]39,00
[/TD]
[TD][/TD]
[TD]JKL
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


"DATA" looks like this.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Account2
[/TD]
[TD]Id1
[/TD]
[TD]Id2
[/TD]
[TD]Document symbol[/TD]
[TD]Description
[/TD]
[TD]Dt2
[/TD]
[TD]Ct2
[/TD]
[TD]Date
[/TD]
[TD]Document number
[/TD]
[TD]Id3
[/TD]
[TD]Id4
[/TD]
[TD]Id5
[/TD]
[TD]Id6
[/TD]
[TD]Id7
[/TD]
[/TR]
[TR]
[TD]111-2-333-33333-5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD][/TD]
[TD]ABC
[/TD]
[TD]25,00
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]777-2-888-88888-5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD][/TD]
[TD]JKL
[/TD]
[TD]
[/TD]
[TD]39,00
[/TD]
[TD][/TD]
[TD][/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]888
[/TD]
[TD]88888
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]777-2-333-33333-5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD][/TD]
[TD]DEF
[/TD]
[TD][/TD]
[TD]22,00
[/TD]
[TD][/TD]
[TD][/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]777-2-333-33333-5555
[/TD]
[TD]01
[/TD]
[TD]99999
[/TD]
[TD][/TD]
[TD]DEFg
[/TD]
[TD]
[/TD]
[TD]3,00
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]111-2-333-33333-5555
[/TD]
[TD]27
[/TD]
[TD]99999
[/TD]
[TD][/TD]
[TD]CCC
[/TD]
[TD]8,50
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]111-2-888-88888-5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD][/TD]
[TD]GHI
[/TD]
[TD]39,00
[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]888
[/TD]
[TD]88888
[/TD]
[TD]5555
[/TD]
[/TR]
[TR]
[TD]111-2-333-33333-5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD][/TD]
[TD]DDD
[/TD]
[TD]13,49
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[/TR]
</tbody>[/TABLE]


Result:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Date
[/TD]
[TD]Account1
[/TD]
[TD]Settlement
[/TD]
[TD]Dt
[/TD]
[TD]Ct
[/TD]
[TD]Description
[/TD]
[TD]Currency
[/TD]
[TD]Transaction type
[/TD]
[TD]Id3
[/TD]
[TD]Id4
[/TD]
[TD]Id5
[/TD]
[TD]Id6
[/TD]
[TD]Id7
[/TD]
[TD]Id1
[/TD]
[TD]Id2
[/TD]
[TD]Dt2
[/TD]
[TD]Ct2
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementX
[/TD]
[TD][/TD]
[TD]25,00
[/TD]
[TD]ABC
[/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD]25,00
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementX
[/TD]
[TD]25,00
[/TD]
[TD][/TD]
[TD]DEF
[/TD]
[TD][/TD]
[TD][/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD]
[/TD]
[TD]22,00
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementY
[/TD]
[TD][/TD]
[TD]39,00
[/TD]
[TD]GHI
[/TD]
[TD][/TD]
[TD][/TD]
[TD]111
[/TD]
[TD]2
[/TD]
[TD]888
[/TD]
[TD]88888
[/TD]
[TD]5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD]39,00
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementY
[/TD]
[TD]39,00
[/TD]
[TD][/TD]
[TD]JKL
[/TD]
[TD][/TD]
[TD]
[/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]888
[/TD]
[TD]88888
[/TD]
[TD]5555
[/TD]
[TD]00
[/TD]
[TD]00000
[/TD]
[TD]
[/TD]
[TD]39,00
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]settlementX
[/TD]
[TD][/TD]
[TD][/TD]
[TD]DEFg
[/TD]
[TD][/TD]
[TD][/TD]
[TD]777
[/TD]
[TD]2
[/TD]
[TD]333
[/TD]
[TD]33333
[/TD]
[TD]5555
[/TD]
[TD]01
[/TD]
[TD]99999
[/TD]
[TD]
[/TD]
[TD]3,00
[/TD]
[/TR]
</tbody>[/TABLE]


I tried to make it as readable as possible, forgive me if anything is unclear.
I would be very grateful for some help or tips.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
While you can use fuzzy lookup to find similar Description data, since you are dealing with accounting data my advice would be to first edit your Description data so it is standard in both sheets, then do your automation.
 
Upvote 0
While you can use fuzzy lookup to find similar Description data, since you are dealing with accounting data my advice would be to first edit your Description data so it is standard in both sheets, then do your automation.

Thank you for the advice, but I can only use standard Excel version at work, I can't download any add-ins unfortunatelly. I can code my own VBA if this would be the only option, but I don't know VBA very well, that's why I tried different formulas.
 
Upvote 0

Forum statistics

Threads
1,223,892
Messages
6,175,236
Members
452,621
Latest member
Laura_PinksBTHFT

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