Match one cell data in two worksheets and copy 3 cells data across

roccoau

New Member
Joined
Dec 25, 2016
Messages
22
Office Version
  1. 365
Hi
I have data in two worksheets.
In worksheet1 column AF has a list of Purchase orders
In worksheet2 column B also has a list of Purchase orders
I would like to compare both worksheets and when a similar PO number is found, I would like the data in columns A and C in worksheet2 copied across to columns AD & AB in worksheet1, respectively
Sample attached
Sorry, I am only new to Excel, and I would greatly appreciate any help :)
 

Attachments

  • 1.jpg
    1.jpg
    159.7 KB · Views: 5

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
1. Cannot manipulate data in a picture. Please reload your data using XL2BB. Your sample only needs to be 8-12 records.
2. What version of XL are you using. Please update your profile to reflect that information as it will determine which functions within XL to use to solve your issue.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Match data in two worksheets and copy 2 columns accross
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
1. Cannot manipulate data in a picture. Please reload your data using XL2BB. Your sample only needs to be 8-12 records.
2. What version of XL are you using. Please update your profile to reflect that information as it will determine which functions within XL to use to solve your issue.

1. Cannot manipulate data in a picture. Please reload your data using XL2BB. Your sample only needs to be 8-12 records.
2. What version of XL are you using. Please update your profile to reflect that information as it will determine which functions within XL to use to solve your issue.
Hi Thanks for advise on this
Not sure if I am doing it right

Workshhet1
Sample.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Date of transactionTransactionAmount (OMR) VATDeclaration Number As Per Import Purchase Log (JDE)06.Imports Bill Of Entry NumberName Of The SupplierLocation (Country) Of The Supplier - Place Of Supply ,Along With Complete AddressLocation (Country) Of The SupplierTax CodeNature Of SupplyInvoice NumberDate Of InvoiceInvoice ValueRate Of ExchangeQuantityVAT AmountValue Of Purchase In OMRDate Of Imports Of GoodsBill Of Entry NumberVAT Paid (YES/NO/Suspended)Value Of Goods As Per CustomsCustoms DutyExcise TaxTaxable Value Of Goods As Per Customers(CIF+Customs Duty+Excise Tax)VAT Amount ( Import Log)CompanyGL DateInvoice TypeInvoice NumberPurchase Order TypePurchase Order
917/07/2023U-PO000731
1017/07/2023U-PO000714
1117/07/2023U-PO000731
1217/07/2023U-PO000587
1317/07/2023U-PO000552
1418/07/2023U-PO000288
Worksheet1




Worksheet2
Sample.xlsx
ABCD
1No.Order No.Posting DateVendor Invoice No.
2U-PPI002451U-PO00076428/11/202323006139
3U-PPI002450U-PO00086028/11/202323070020
4U-PPI002449U-PO00132927/11/202323-441
5U-PPI002443U-PO00130827/11/20232023003577
6U-PPI002442U-PO00129527/11/2023CINV-230020211
7U-PPI002441U-PO00101727/11/2023SS-K 5964/2023
8U-PPI002440U-PO00124327/11/2023SIV-23/1078
9U-PPI002439U-PO00127827/11/2023UG/UAE/INV/2023/824
10U-PPI002438U-PO00127827/11/2023UG/UAE/INV/2023/859
11U-PPI002437U-PO00119727/11/20237500023157
12U-PPI002436U-PO00125127/11/20237500023595
13U-PPI002435U-PO00127727/11/20237500023594
14U-PPI002434U-PO00127727/11/20237500023501
15U-PPI002433U-PO00126827/11/20237500023470
16U-PPI002432U-PO00125127/11/20237500023312
17U-PPI002431U-PO00086727/11/2023CTI/23-24/TI-19
18U-PPI002430U-PO00088127/11/202323006146
19U-PPI002429U-PO00134327/11/2023IN-1749U-02
20U-PPI002428U-PO00131427/11/2023PI 51464
21U-PPI002427U-PO00056927/11/2023CTI/23-24/TI-18
22U-PPI002426U-PO00085727/11/2023INV01234
23U-PPI002425U-PO00077727/11/20231810002600
24U-PPI002424U-PO00063427/11/202320230442
Worksheet2
 
Upvote 0
Sounds like this is a simple Lookup.
Try this for Column AB
Excel Formula:
=IF($AF2<>"",XLOOKUP($AF2,Sheet1!$B:$B,Sheet1!$C:$C,"NOT FOUND"),"")
And this for Column AD
Excel Formula:
=IF($AF2<>"",XLOOKUP($AF2,Sheet1!$B:$B,Sheet1!$A:$A,"NOT FOUND"),"")
 
Upvote 0
Sounds like this is a simple Lookup.
Try this for Column AB
Excel Formula:
=IF($AF2<>"",XLOOKUP($AF2,Sheet1!$B:$B,Sheet1!$C:$C,"NOT FOUND"),"")
And this for Column AD
Excel Formula:
=IF($AF2<>"",XLOOKUP($AF2,Sheet1!$B:$B,Sheet1!$A:$A,"NOT FOUND"),"")


Thanks for tip
I got it to work with below code

AD =XLOOKUP(@AF:AF,sheet2!B:B,sheet2!A:A,"NOT FOUND")

AB =XLOOKUP(@AF:AF,sheet2!B:B,sheet2!C:C,"NOT FOUND")
 
Upvote 0
Hi I have another problem I would like to find a solution for, if someone can please give advice.
Sheet1 and Sheet2 sometimes have the same purchase order number listed multiple times on each sheet.
When there is only one PO number listed and I do the XLookup from sheet1 cell AF and match the PO number in sheet2 cell B the value in Sheet 2 cell A is returned to Cell AD in Sheet 1
But when there is more than one PO listed in each sheet, the returned data to sheet1 Cell AD from Cell A in Sheet2 is always the same data which is always taken from the first occurrence of the PO no in sheet 2.
Is there a way to list the next lot of data from CELL A in sheet2 for the subsequent same PO number quoted and any other subsequent same PO with the same PO number quoted ?

The current formula is AD =XLOOKUP(@AF:AF,sheet2!B:B,sheet2!A:A,"NOT FOUND") but not sure what to add to accomplish the above if at all possible

Thank for any help
 
Upvote 0
Sample below
Sheet 1
VAT Detals Accounts data template (1).xlsx
AF
9U-PO000552
10U-PO000731
11U-PO000587
sheet1
 
Upvote 0
Sample Sheet 1

VAT Detals Accounts data template (1).xlsx
ADAEAF
1Invoice NumberPurchase Order TypePurchase Order
2NOT FOUNDPOPAST PO HERE (AF)
3U-PPI001657POU-PO000850
4U-PPI001714POU-PO000763
5U-PPI002155POU-PO000731
6U-PPI001476POU-PO000714
7U-PPI002155POU-PO000731
8U-PPI002154POU-PO000587
9U-PPI002318POU-PO000552
10U-PPI002155POU-PO000731
11U-PPI002154POU-PO000587
12U-PPI002233POU-PO000539
13NOT FOUNDPOU-PO000703
14U-PPI001512POU-PO000606
15U-PPI001927POU-PO000973
16NOT FOUNDPOU-PO000647
17NOT FOUNDPOU-PO000552
18U-PPI002272POU-PO000599
19U-PPI001866POU-PO000794
20U-PPI002155POU-PO000731
21U-PPI002154POU-PO000587
22U-PPI001927POU-PO000973
23U-PPI002050POU-PO000798
24U-PPI002155POU-PO000731
25U-PPI002154POU-PO000587
26U-PPI002082POU-PO000627
27U-PPI002255POU-PO000855
28U-PPI002102POU-PO000616
29U-PPI002255POU-PO000855
30U-PPI002102POU-PO000616
31U-PPI001654POU-PO000957
32U-PPI001458POU-PO000607
33U-PPI001941POU-PO000999
34U-PPI001512POU-PO000606
sheet1
Cell Formulas
RangeFormula
AD2:AD34AD2=XLOOKUP(AF:AF,sheet2!B:B,sheet2!A:A,"NOT FOUND")





SHEET 2


VAT Detals Accounts data template (1).xlsx
ABCD
1No.Order No.Posting DateVendor Invoice No.
2U-PPI002451U-PO00076428/11/202323006139
3U-PPI002450U-PO00086028/11/202323070020
4U-PPI002449U-PO00132927/11/202323-441
5U-PPI002443U-PO00130827/11/20232023003577
6U-PPI002442U-PO00129527/11/2023CINV-230020211
7U-PPI002441U-PO00101727/11/2023SS-K 5964/2023
8U-PPI002440U-PO00124327/11/2023SIV-23/1078
9U-PPI002439U-PO00127827/11/2023UG/UAE/INV/2023/824
10U-PPI002438U-PO00127827/11/2023UG/UAE/INV/2023/859
11U-PPI002437U-PO00119727/11/20237500023157
12U-PPI002436U-PO00125127/11/20237500023595
13U-PPI002435U-PO00127727/11/20237500023594
14U-PPI002434U-PO00127727/11/20237500023501
15U-PPI002433U-PO00126827/11/20237500023470
16U-PPI002432U-PO00125127/11/20237500023312
17U-PPI002431U-PO00086727/11/2023CTI/23-24/TI-19
18U-PPI002430U-PO00085527/11/202323006146
19U-PPI002429U-PO000616 27/11/2023IN-1749U-02
20U-PPI002428U-PO00085527/11/2023PI 51464
21U-PPI002427U-PO000616 27/11/2023CTI/23-24/TI-18
22U-PPI002426U-PO00085727/11/2023INV01234
23U-PPI002425U-PO00077727/11/20231810002600
24U-PPI002424U-PO00063427/11/202320230442
25U-PPI002423U-PO00108427/11/2023SIN-HE-23-00705
26U-PPI002422U-PO00133527/11/2023SO073378-1
27U-PPI002421U-PO00069327/11/202323005956
28U-PPI002420U-PO00061027/11/2023QTECH-23-0149
29U-PPI002419U-PO00113927/11/2023STE/CIN-24122462
30U-PPI002418U-PO00132727/11/2023UG/UAE/INV/2023/858
31U-PPI002416U-PO00114027/11/202320230230
32U-PPI002417U-PO00113920/11/2023STE/CIN-24122122
33U-PPI002415U-PO00129620/11/2023DXB035493
34U-PPI002405U-PO00034415/11/202323000428/NI
35U-PPI002404U-PO00124915/11/2023002/CRINV/2023004228
36U-PPI002403U-PO00124215/11/2023002/CRINV/2023004229
37U-PPI002402U-PO00132314/11/2023DXB035727
38U-PPI002401U-PO00132314/11/2023DXB035726
39U-PPI002400U-PO00132314/11/2023DXB035725
40U-PPI002399U-PO00132314/11/2023DXB035724
41U-PPI002398U-PO00132314/11/2023DXB035723
42U-PPI002397U-PO00132314/11/2023DXB035722
43U-PPI002396U-PO00132314/11/2023DXB035721
44U-PPI002395U-PO00132314/11/2023DXB035720
45U-PPI002394U-PO00132314/11/2023DXB035719
46U-PPI002393U-PO00132314/11/2023DXB035718
47U-PPI002392U-PO00132314/11/2023DXB035717
48U-PPI002391U-PO00132314/11/2023DXB035716
49U-PPI002390U-PO00132314/11/2023DXB035715
50U-PPI002389U-PO00132314/11/2023DXB035714
51U-PPI002388U-PO00132314/11/2023DXB035713
52U-PPI002387U-PO00132314/11/2023DXB035712
53U-PPI002386U-PO00132314/11/2023DXB035711
54U-PPI002385U-PO00132314/11/2023DXB035710
55U-PPI002384U-PO00132314/11/2023DXB035709
56U-PPI002383U-PO00132314/11/2023DXB035708
57U-PPI002382U-PO00132314/11/2023DXB035707
58U-PPI002381U-PO00132314/11/2023DXB035706
59U-PPI002380U-PO00132314/11/2023DXB035704
60U-PPI002379U-PO00132314/11/2023DXB035703
61U-PPI002378U-PO00132314/11/2023DXB035702
62U-PPI002377U-PO00132314/11/2023DXB035701
63U-PPI002376U-PO00132314/11/2023DXB035690
64U-PPI002375U-PO00132314/11/2023DXB035691
65U-PPI002374U-PO00132314/11/2023DXB035692
66U-PPI002373U-PO00132314/11/2023DXB035693
67U-PPI002372U-PO00132314/11/2023DXB035694
68U-PPI002371U-PO00132314/11/2023DXB035696
69U-PPI002370U-PO00132314/11/2023DXB035695
70U-PPI002369U-PO00132314/11/2023DXB035689
71U-PPI002368U-PO00132314/11/2023DXB035688
72U-PPI002367U-PO00129614/11/2023DXB035728
73U-PPI002366U-PO00129614/11/2023DXB035513
74U-PPI002365U-PO00129614/11/2023DXB035512
75U-PPI002364U-PO00129614/11/2023DXB035510
76U-PPI002363U-PO00129614/11/2023DXB035509
77U-PPI002362U-PO00129614/11/2023DXB035508
78U-PPI002361U-PO00129614/11/2023DXB035506
79U-PPI002360U-PO00129614/11/2023DXB035505
80U-PPI002359U-PO00129614/11/2023DXB035504
81U-PPI002358U-PO00129614/11/2023DXB035503
82U-PPI002357U-PO00129614/11/2023DXB035502
83U-PPI002356U-PO00129614/11/2023DXB035501
84U-PPI002355U-PO00129614/11/2023DXB035500
85U-PPI002354U-PO00129614/11/2023DXB035499
86U-PPI002353U-PO00129614/11/2023DXB035498
87U-PPI002352U-PO00129614/11/2023DXB035497
88U-PPI002351U-PO00129614/11/2023DXB035496
89U-PPI002350U-PO00129614/11/2023DXB035495
90U-PPI002349U-PO00129614/11/2023DXB035494
91U-PPI002348U-PO00129614/11/2023DXB035491
92U-PPI002347U-PO00129614/11/2023DXB035490
93U-PPI002346U-PO00129614/11/2023DXB035488
94U-PPI002342U-PO00132114/11/2023QCP-INV-2023-13870
95U-PPI002341U-PO00061014/11/2023QTECH-23-0130
96U-PPI002340U-PO00063814/11/202312008
97U-PPI002339U-PO00063814/11/202311989
98U-PPI002338U-PO00076414/11/202323003156
99U-PPI002337U-PO00091314/11/202323006005
100U-PPI002336U-PO00131014/11/2023STE/CIN-24122376
101U-PPI002335U-PO00131314/11/2023SIV-23/1183
102U-PPI002334U-PO00121114/11/2023ASO-SAL-230395
103U-PPI002333U-PO00128813/11/20232310024
104U-PPI002332U-PO00123010/11/2023IN-1752-03 (1584U)
105U-PPI002331U-PO00123010/11/2023IN-1562U-04
106U-PPI002330U-PO00116210/11/2023173853
107U-PPI002329U-PO00120010/11/2023237600247
108U-PPI002328U-PO00123410/11/2023173856
109U-PPI002327U-PO00123410/11/2023173854
110U-PPI002326U-PO00104310/11/2023PPIN095496
111U-PPI002325U-PO00130110/11/2023DQT-170853
112U-PPI002324U-PO00123110/11/2023IN/181993
113U-PPI002323U-PO00121910/11/2023IN/181994
114U-PPI002322U-PO00127110/11/20236020221
115U-PPI002321U-PO00128310/11/20236020286
116U-PPI002320U-PO00122310/11/2023REL/ES/23-24/037
117U-PPI002319U-PO00117810/11/20234630002889
118U-PPI002318U-PO00055210/11/2023POI005846
119U-PPI002317U-PO00125210/11/2023ZE2310-1110
120U-PPI002316U-PO00071710/11/2023POI005847
121U-PPI002315U-PO00067710/11/2023POI005816
122U-PPI002314U-PO00118810/11/2023PF-217 GIC/23-24
123U-PPI002313U-PO00063510/11/20232023000348
124U-PPI002312U-PO00074510/11/20232023001478
125U-PPI002311U-PO00107210/11/20232023002749
126U-PPI002310U-PO00058010/11/2023SS-K 5126/2022
127U-PPI002309U-PO00075810/11/2023237600242
128U-PPI002305U-PO0009779/11/2023ARDGB975
129U-PPI002304U-PO0011019/11/2023ARDGB974
130U-PPI002303U-PO0009669/11/2023S.INV20231019
131U-PPI002302U-PO0006989/11/2023RI-0158/2023/COMM/AS/INV-155
132U-PPI002301U-PO0007029/11/2023RI-0157/2023/COMM/AS/INV-162
133U-PPI002300U-PO0006819/11/2023RI-0154/2023/COMM/AS/INV-154
134U-PPI002299U-PO0008549/11/2023RSPL/E/2324/453
135U-PPI002308U-PO0008396/11/2023237600190
136U-PPI002295U-PO0007076/11/20234000576704
137U-PPI002294U-PO00088131/10/202323005345
138U-PPI002293U-PO00069331/10/202323005346
139U-PPI002292U-PO00069331/10/202323005340
140U-PPI002291U-PO00114331/10/202323-12989
141U-PPI002290U-PO00114331/10/202323-12981
142U-PPI002289U-PO00072531/10/202323-12637
143U-PPI002288U-PO00114531/10/2023INV-0077
144U-PPI002287U-PO00017131/10/2023RI 23018901
145U-PPI002286U-PO00074531/10/20232023002534
146U-PPI002285U-PO00075131/10/20232023002256
147U-PPI002284U-PO00075131/10/20232023002180
148U-PPI002283U-PO00074431/10/20232023002177
149U-PPI002282U-PO00074431/10/20232023002255.
150U-PPI002281U-PO00101931/10/20232023002255
151U-PPI002280U-PO00081231/10/20232023002048
152U-PPI002279U-PO00081231/10/20232023002181
153U-PPI002278U-PO00116531/10/20232023003260
154U-PPI002277U-PO00120231/10/20232023003262
155U-PPI002276U-PO00120631/10/20232023003261
156U-PPI002275U-PO00116831/10/20232023003013
157U-PPI002274U-PO00118731/10/20232023003259
158U-PPI002273U-PO00120331/10/20232023003258
159U-PPI002272U-PO00059931/10/2023INV01053
160U-PPI002271U-PO00059931/10/2023INV01046
sheet2
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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