Lookup formula

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
Hello
I have a spreadsheet that has 6000 postcodes in column A and only 3000 postcodes in column B, and towns in column c, I would like to match up whats in column a and b and if it is a match i would like to add into column D the name of the town. I cannot do this by cell as all of the postcodes are mixed through, any help would be appreciated if there is a formula i can use?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Im not sure what column you want to lookup to and from, or how many towns are in column c. But, here is a guess at a solution.
And i don't use post codes, I use zip codes, so my guess at to valid postcodes is just random number and text strings.
I'm using 60 and 30 instead of 6000 and 3000, you can scale it up.

Book1
ABCD
1PostCode1Postcode2TownResult
2P61F70O59P05Town1Not Found
3Y89C57Z07T42Town2Town8
4X50Y96O59P05Town3Not Found
5O29N27F36R94Town4Town28
6B92A83X20Z72Town5Town13
7K76T76F36R94Town6Town28
8R72R86Y37K75Town7Not Found
9Z07T42F03S76Town8Not Found
10C46N00J04E35Town9Not Found
11Z05I51X50Y96Town10Town3
12G02M97F36R94Town11Town28
13D64Z20D64Z20Town12Town12
14X20Z72Y37K75Town13Not Found
15T51M04V19B68Town14Not Found
16W26U68R97O51Town15Not Found
17I66M74D64Z20Town16Town12
18S35M42E20G73Town17Not Found
19E43M98C77A92Town18Not Found
20R93Y90F03S76Town19Not Found
21A33K64U82F72Town20Town23
22E60M00V67B61Town21Not Found
23R62U44N38I51Town22Not Found
24U82F72A48Y46Town23Not Found
25K60E08C77A92Town24Not Found
26F46X66Z65R49Town25Not Found
27O11F59R93Y90Town26Town19
28Z68H97F03S76Town27Not Found
29F36R94X50Y96Town28Town3
30F45O62O59P05Town29Not Found
31H67E87I66M74Town30Town16
32E23R50Town31
33R97O51Town32
34X75O57Town33
35U14D22Town34
36J88Q19Town35
37E37T02Town36
38O59P05Town37
39F78S92Town38
40Z65R49Town39
41X50V34Town40
42L74V18Town41
43F76I96Town42
44A48Y46Town43
45H36H96Town44
46J04E35Town45
47V67B61Town46
48E00I58Town47
49M80U70Town48
50Z26F36Town49
51E20G73Town50
52W48T80Town51
53V86U17Town52
54V19B68Town53
55Y78U04Town54
56F03S76Town55
57K10N21Town56
58N38I51Town57
59Y37K75Town58
60F09G71Town59
61C77A92Town60
Sheet1
Cell Formulas
RangeFormula
D2:D31D2=IFERROR(INDEX($C$2:$C$31,MATCH(B2,$A$2:$A$61,0)),"Not Found")
 
Upvote 0
Thank you for your quick response, so for example the postcode in your list in column B (postcode 2) O59P05 im trying to find out if it is listed in column A (postcode 1) and if it is then i want to enter the town from Column C into Column D. Hope this makes sense. any help is appreciated.
 
Upvote 0
Thank you for your quick response, so for example the postcode in your list in column B (postcode 2) O59P05 im trying to find out if it is listed in column A (postcode 1) and if it is then i want to enter the town from Column C into Column D. Hope this makes sense. any help is appreciated.
how about this:

Book1
ABCD
1PostCode1Postcode2TownResult
2P61F70O59P05Town1Town37
3Y89C57Z07T42Town2Town8
4X50Y96O59P05Town3Town37
5O29N27F36R94Town4Town28
6B92A83X20Z72Town5Town13
7K76T76F36R94Town6Town28
8R72R86Y37K75Town7Town58
9Z07T42F03S76Town8Town55
10C46N00J04E35Town9Town45
11Z05I51X50Y96Town10Town3
12G02M97F36R94Town11Town28
13D64Z20D64Z20Town12Town12
14X20Z72Y37K75Town13Town58
15T51M04V19B68Town14Town53
16W26U68R97O51Town15Town32
17I66M74D64Z20Town16Town12
18S35M42E20G73Town17Town50
19E43M98C77A92Town18Town60
20R93Y90F03S76Town19Town55
21A33K64U82F72Town20Town23
22E60M00V67B61Town21Town46
23R62U44N38I51Town22Town57
24U82F72A48Y46Town23Town43
25K60E08C77A92Town24Town60
26F46X66Z65R49Town25Town39
27O11F59R93Y90Town26Town19
28Z68H97F03S76Town27Town55
29F36R94X50Y96Town28Town3
30F45O62O59P05Town29Town37
31H67E87I66M74Town30Town16
32E23R50Town31
33R97O51Town32
34X75O57Town33
35U14D22Town34
36J88Q19Town35
37E37T02Town36
38O59P05Town37
39F78S92Town38
40Z65R49Town39
41X50V34Town40
42L74V18Town41
43F76I96Town42
44A48Y46Town43
45H36H96Town44
46J04E35Town45
47V67B61Town46
48E00I58Town47
49M80U70Town48
50Z26F36Town49
51E20G73Town50
52W48T80Town51
53V86U17Town52
54V19B68Town53
55Y78U04Town54
56F03S76Town55
57K10N21Town56
58N38I51Town57
59Y37K75Town58
60F09G71Town59
61C77A92Town60
Sheet1
Cell Formulas
RangeFormula
D2:D31D2=IFERROR(INDEX($C$2:$C$61,MATCH(B2,$A$2:$A$61,0)),"Not Found")
 
Upvote 0
everything is just coming up as not found, do you think its looking for a match between A1 and B1 where i need it to search the whole of column a? Column D should be the same town as column C
 
Upvote 0
Check your formulas. (or share yours? a minisheet would be helpful). As you can see the mini sheet is post 4 is working. How about pasting my mini sheet into a fresh worksheet and see if it works.

remember to scale up your formula to 6000?

Excel Formula:
=IFERROR(INDEX($C$2:$C$6001,MATCH(B2,$A$2:$A$6001,0)),"Not Found")
 
Upvote 0
Solution
Great! I am pleased to help.

Best Wishes!
 
Upvote 0

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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