Lookup with a fill down based on another field - how the heck do I explain this :)

MattDanFrank2

New Member
Joined
Sep 19, 2012
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi there,

As always, thanks in advance for any help. Thank you. This one is bending my little brain.

I have two tables with serial numbers.

The first table has (let's call it the master table) has serial numbers and the related account numbers.

The second table (let's call is the slave table) has serial numbers and related account names (but no account numbers).

The objective is to lookup the account number from the first table and place it on the second table.

But, and here's the twist, the second table has many serial numbers that are not in the first table, but there will always be at least one that matches.

Take the first example. In table 2 there is serial number 1 related to Jim Ltd, which relates to account number 1001 in table 1. What I need the formula to do is populate any other instances of Jim Ltd with account number 1001.

In the second example, in table 2 there is serial number 6 related to Frank Corp, which relates to account number 1002 in table 1. What I need the formula to do is populate any other instances of Frank Corp with account number 1002.

I hope that make sense.

Matt

p.s. I have tried to install XL2BB but my work laptop won't let it work. :(
 

Attachments

  • MR-EXCEL.PNG
    MR-EXCEL.PNG
    33.2 KB · Views: 12

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try this
Excel Formula:
=VLOOKUP(MIN(IF([Company Name]=[@[Company Name]],[Serial Number])),Table1,2,0)
 

Attachments

  • 1674825519138.png
    1674825519138.png
    37.8 KB · Views: 5
Upvote 0
Hi shinigamilight,

You've solved it!!! Thank you!!!

There's a wrinkle I forgot to mention though...I'm my example, I used serial numbers that were numbers only, in my real life example, however, they are alphanumeric, and I'm running into #N/A as a result. I think I've also got the issue of numbers stored as text. Urrghhh. Is there another function you can use that can brute-force around this? Any help or further advice would be greatly appreciated.

I really appreciate your help.
 
Upvote 0
Thanks for your patience. Here is a sample:

7581200005
8022579763
18350412029
19350322030
19350322031
19350322032
9.45E+11
4.42609E+12
7.52714E+12
7.52991E+12
(654e)
1095KSPOR
201911S002A030
22D21416
22E04260
22E04443
22E06452
22E23905
22E24469
22E26213
22E26313
22E30548
22F04323
22F18918
2318W520146
235-121-4809
25Y03012
27Q01105
2CG02653
2ER02452
2ER02759
2ER02967
2ER03056
CNCJ369251
CNCJ36930
CNCJ369301
CNCJ36939
CNCJ369391
CNCJ36941
CNCJ369411
CNCJ36988
 
Upvote 0
Hi shinigamilight,

I hope you're well - thank you again for all your help so far. I'm hoping you are able to help with this alphanumeric lookup challenge, too, please. If not, any guidance or direction is appreciated.

Best wishes and thanks, Matt
 
Upvote 0
DO you have xl2bb? Upload some data properly highlighting the lookup table and the table in which you need the output.

 
Upvote 0
Hi shinigamilight,

After manually installing XL2BB, I got it working successfully. :) OK, here are two versions, one with the simple Serial Numbers and your original formula. And second with the alphanumeric Serial Numbers and your original formula. Maximum thank you.

Serial NumberAccount NumberSerial NumberCompany NameLooked Up Account Number
110011Jim Ltd1001
2100199Jim Ltd1001
31001129Jim Ltd1001
41001324Jim Ltd1001
51001532Frank Corp1002
610026Frank Corp1002
71002432Frank Corp1002
8100343Jill Biz1003
910039Jill Biz1003
1010048Jill Biz1003



Serial NumberAccount NumberSerial NumberCompany NameLooked Up Account Number
CNCJ3692511001CNCJ369251Jim Ltd#N/A
CNCJ369881001QW12133Jim Ltd#N/A
CNCJ3694111001WQ32132132Jim Ltd#N/A
2CG026531001WQ2323323255Jim Ltd#N/A
27Q011051001WQ6546546545Frank Corp#N/A
201911S002A0301002201911S002A030Frank Corp#N/A
22E244691002QW7657657657665Frank Corp#N/A
235-121-48091003WQ87876876876Jill Biz#N/A
1095KSPOR10031095KSPORJill Biz#N/A
(654e)1004235-121-4809Jill Biz#N/A
 
Upvote 0
How about
Fluff.xlsm
ABCDEF
1Serial NumberAccount NumberSerial NumberCompany NameLooked Up Account Number
2CNCJ3692511001CNCJ369251Jim Ltd1001
3CNCJ369881001QW12133Jim Ltd1001
4CNCJ3694111001WQ32132132Jim Ltd1001
52CG026531001WQ2323323255Jim Ltd1001
627Q011051001WQ6546546545Frank Corp1002
7201911S002A0301002201911S002A030Frank Corp1002
822E244691002QW7657657657665Frank Corp1002
9235-121-48091003WQ87876876876Jill Biz1003
101095KSPOR10031095KSPORJill Biz1003
11(654e)1004235-121-4809Jill Biz1003
Lists
Cell Formulas
RangeFormula
F2:F11F2=TAKE(SORT(XLOOKUP(FILTER($D$2:$D$11,$E$2:$E$11=E2),$A$2:$A$11,$B$2:$B$11,"")),1)
 
Upvote 0
You can try this.
Excel Formula:
=LET(a,XLOOKUP(FILTER($D$2:$D$11,$E$2:$E$11=E2),$A$2:$A$11,$B$2:$B$11,"",0),DROP(FILTER(a,a<>""),COUNTA(FILTER(a,a<>""))-1))
 

Attachments

  • 1675339605755.png
    1675339605755.png
    49.5 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

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