Match 2 Worksheet and put exact number if it matches in the second sheet.

nidhinair22

New Member
Joined
Jan 16, 2023
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi...

I have a query. I have an excell sheet with 2000 rows of different vehicle mumbers. I each row there it will be 1 vehilce number, which i'm having in my second sheet. I want to extract that vehicle number and to put it in a seperate column. Please help me to match with a formula.



Invh AnnotationVEH #
DELIVERY AT RUMAIZ, CONT 96562814. CASH TRF IN BM RO.. 750.. DT 31/5/2023..VEH NO. 1154 DRIVER- ABU NASSER
DELIVERY AT LISUQ, CONT 93582921.. CASH TRF IN BM RO..3500.. DT 31/5/23.-VEH NO. 6924DS Tarseem
DELIVERY AT SUMAIL.CONTACT-IQBAL-94023163--- 92660283--VEH NO. 6924DS DRIVER- TARSEEM
DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM
DELIVERY TO SEEB CONT: 95441442--VEH NO. 4886 MK- BALRAJ
DELIVERY AT SUMAIL.CONTACT-91830183--VEH NIO. 6924DS DRIVER- TARSEEM
DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM
DELIVERY AT MISFAH, CONTACT NO - 77173212--VEH NO. 6894DS DRIVER- BALRAJ
DELIVERY AT MISFA CONT:-CONT:-92765187..F- 94610485- CASH TRF- DT- 31/05/2023--VEH NO.6894 DRIVER- BALRAJ
DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ
DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ
EX GHALA YARD..DRIVER-MUHAMMAD ABDUL NISAR- VEH NO. 5610YW.
DELIVERY AT WUDAM..CONTACT DINTO-91489249..VEH NO...6943MK DRIVER SATPAL SINGH..LOADING FROM MUSANNA YARD
MATERIAL DIRECTLY SUPPLIED TO METO UNDER MD-50565 DO NO-SB23530-017 VEH NO - 7324HW DRV- SHAHZAD--MANUAL DO -50565
DELIVERY AT BIDIYA CONT-94133339 DRV SAMI ULLAH VEH 2533/YR
DELIVERY AT W.B.K CONT-96188300 F-78061971 DRV SAMI ULLAH VEH 2533/YR
DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR
DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR
DELIVERY AT HAIMA CONT-93667755 F-71228389 DRV SAMI ULLAH VEH 2533/YR
DELIVERY AT JARDA CONT-98427013 F99640586 DRV SAMI ULLAH VEH 2533/YR

VEH #
2532YR
1156YW
5303WB
6943MK
8209RK
6942MK
3914DK
4475DS
9161YR
9574RK
1154YW
2542HA
2891AK
8556ML
2533YR
2662MD
5686DS
4886MK
5001MK
6778MK
6894DS
6924DS
3135WB
4071RK
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try the below:
Book1.xlsm
BCDE
2Invh AnnotationVEH #VEH #
3DELIVERY AT RUMAIZ, CONT 96562814. CASH TRF IN BM RO.. 750.. DT 31/5/2023..VEH NO. 1154 DRIVER- ABU NASSER 2532YR
4DELIVERY AT LISUQ, CONT 93582921.. CASH TRF IN BM RO..3500.. DT 31/5/23.-VEH NO. 6924DS Tarseem6924DS 1156YW
5DELIVERY AT SUMAIL.CONTACT-IQBAL-94023163--- 92660283--VEH NO. 6924DS DRIVER- TARSEEM6924DS 5303WB
6DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM6924DS 6943MK
7DELIVERY TO SEEB CONT: 95441442--VEH NO. 4886 MK- BALRAJ4886 MK8209RK
8DELIVERY AT SUMAIL.CONTACT-91830183--VEH NIO. 6924DS DRIVER- TARSEEM6924DS 6942MK
9DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM6924DS 3914DK
10DELIVERY AT MISFAH, CONTACT NO - 77173212--VEH NO. 6894DS DRIVER- BALRAJ6894DS 4475DS
11DELIVERY AT MISFA CONT:-CONT:-92765187..F- 94610485- CASH TRF- DT- 31/05/2023--VEH NO.6894 DRIVER- BALRAJ 9161YR
12DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ6894DS 9574RK
13DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ6894DS 1154YW
14EX GHALA YARD..DRIVER-MUHAMMAD ABDUL NISAR- VEH NO. 5610YW. 2542HA
15DELIVERY AT WUDAM..CONTACT DINTO-91489249..VEH NO...6943MK DRIVER SATPAL SINGH..LOADING FROM MUSANNA YARD6943MK 2891AK
16MATERIAL DIRECTLY SUPPLIED TO METO UNDER MD-50565 DO NO-SB23530-017 VEH NO - 7324HW DRV- SHAHZAD--MANUAL DO -50565 8556ML
17DELIVERY AT BIDIYA CONT-94133339 DRV SAMI ULLAH VEH 2533/YR2533/YR2533YR
18DELIVERY AT W.B.K CONT-96188300 F-78061971 DRV SAMI ULLAH VEH 2533/YR2533/YR2662MD
19DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR2533/YR5686DS
20DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR2533/YR4886 MK
21DELIVERY AT HAIMA CONT-93667755 F-71228389 DRV SAMI ULLAH VEH 2533/YR2533/YR5001MK
22DELIVERY AT JARDA CONT-98427013 F99640586 DRV SAMI ULLAH VEH 2533/YR2533/YR6778MK
236894DS
246924DS
253135WB
264071RK
272533/YR
Sheet8
Cell Formulas
RangeFormula
C3:C22C3=IF(ISNUMBER(LOOKUP(2^15,SEARCH($E$3:$E$27,B3))),MID(B3,LOOKUP(2^15,SEARCH($E$3:$E$27,B3)),7),"")


You will ecounter issues as the Vehicle table needs to have the same format as the extraction. Eg you have 2533YR in the vehicle table and 2533/YR in the extraction. A possibility is to have both 2533YR and 2533/YR in the vehicle table. In order to get the formula to work, I changed 2533YR to 2533/YR.
 
Last edited:
Upvote 0
Here is an alternative:
Book1.xlsm
ABCDEF
2Invh AnnotationVEH #VEH #Helper
3DELIVERY AT RUMAIZ, CONT 96562814. CASH TRF IN BM RO.. 750.. DT 31/5/2023..VEH NO. 1154 DRIVER- ABU NASSER1154YW2532YR2532
4DELIVERY AT LISUQ, CONT 93582921.. CASH TRF IN BM RO..3500.. DT 31/5/23.-VEH NO. 6924DS Tarseem6924DS1156YW1156
5DELIVERY AT SUMAIL.CONTACT-IQBAL-94023163--- 92660283--VEH NO. 6924DS DRIVER- TARSEEM6924DS5303WB5303
6DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM6924DS6943MK6943
7DELIVERY TO SEEB CONT: 95441442--VEH NO. 4886 MK- BALRAJ4886MK8209RK8209
8DELIVERY AT SUMAIL.CONTACT-91830183--VEH NIO. 6924DS DRIVER- TARSEEM6924DS6942MK6942
9DELIVERY AT SUMAIL, CONTACT NO - 99102175-- 93090671-VEH NO. 6924DS DRIVER- TARSEEM6924DS3914DK3914
10DELIVERY AT MISFAH, CONTACT NO - 77173212--VEH NO. 6894DS DRIVER- BALRAJ6894DS4475DS4475
11DELIVERY AT MISFA CONT:-CONT:-92765187..F- 94610485- CASH TRF- DT- 31/05/2023--VEH NO.6894 DRIVER- BALRAJ6894DS9161YR9161
12DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ6894DS9574RK9574
13DELIEVRY AT BOUSHAR MONA , CONTACT NO - 99351760--CASH TRF- DT---6894DS DRIVER- BALRAJ6894DS1154YW1154
14EX GHALA YARD..DRIVER-MUHAMMAD ABDUL NISAR- VEH NO. 5610YW. 2542HA2542
15DELIVERY AT WUDAM..CONTACT DINTO-91489249..VEH NO...6943MK DRIVER SATPAL SINGH..LOADING FROM MUSANNA YARD6943MK2891AK2891
16MATERIAL DIRECTLY SUPPLIED TO METO UNDER MD-50565 DO NO-SB23530-017 VEH NO - 7324HW DRV- SHAHZAD--MANUAL DO -50565 8556ML8556
17DELIVERY AT BIDIYA CONT-94133339 DRV SAMI ULLAH VEH 2533/YR2533YR2533YR2533
18DELIVERY AT W.B.K CONT-96188300 F-78061971 DRV SAMI ULLAH VEH 2533/YR2533YR2662MD2662
19DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR2533YR5686DS5686
20DELIVERY AL-BEDIYA -99428587,97002285 F-92678174, DRV - SAMI ULLAH VEH 2533/YR2533YR4886MK4886
21DELIVERY AT HAIMA CONT-93667755 F-71228389 DRV SAMI ULLAH VEH 2533/YR2533YR5001MK5001
22DELIVERY AT JARDA CONT-98427013 F99640586 DRV SAMI ULLAH VEH 2533/YR2533YR6778MK6778
236894DS6894
246924DS6924
253135WB3135
264071RK4071
Sheet8
Cell Formulas
RangeFormula
C3:C22C3=IF(ISNUMBER(LOOKUP(2^15,SEARCH($F$3:$F$26,B3))),INDEX($E$3:$E$26,MATCH(MID(B3,LOOKUP(2^15,SEARCH($F$3:$F$26,B3)),4),$F$3:$F$26,0)),"")
F3:F26F3=LEFT(E3,4)


What I have had to do is create a table of the vehicles and add a helper column.

What the formula does is looks to see if the registration is in the text. If so, then it takes the first 4 digits and looks in the helper column and returns the regstration. If the registration is not in the list it will return a blank

An advantage of a table is that if you need to add a registration, just add it to the bottom of the list.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,385
Messages
6,171,780
Members
452,424
Latest member
Sheila003

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