Formula to look up a cell - based on values from two different cells

PCloadletter

New Member
Joined
May 14, 2020
Messages
18
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
Hello all,

Been beating myself over the head on how to word this. Thanks in advance for any help.

I currently have two columns - one showing an employees home city and the other their work city and want to pull data from a table to fill in the third column.

UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
VancouverVancouver
VancouverNorth Vancouver
North VancouverNorth Vancouver

The source of the table looks like this :

BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouver West VancouverWhite Rock
Burnaby1222212222222222
Coquitlam2122123111322332
Delta2211223222111331
Langley2211223222311331
Maple Ridge2122123111322332
New Westminster1222212222222222
North Vancouver2333321333233213
Pitt Meadows2122123111322332
Port Coquitlam2122123111322332
Port Moody2122123111322332
Richmond2313322333131223
Surrey2211223222311331
Tsawwassen2211223222111331
Vancouver 2333322333233123
West Vancouver2333321333233213
White Rock 2211223222311331

Looking to pull the number from the chart into the "Qualified Zones" column.

Thank you again in advance.
 
Book8
ABCDEFGHIJKLMNOPQ
1BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouverWest VancouverWhite Rock
2Burnaby1222212222222222
3Coquitlam2122123111322332
4Delta2211223222111331
5Langley2211223222311331
6Maple Ridge2122123111322332
7New Westminster1222212222222222
8North Vancouver2333321333233213
9Pitt Meadows2122123111322332
10Port Coquitlam2122123111322332
11Port Moody2122123111322332
12Richmond2313322333131223
13Surrey2211223222311331
14Tsawwassen2211223222111331
15Vancouver2333322333233123
16West Vancouver2333321333233213
17White Rock2211223222311331
18
19
20UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
21VancouverVancouver1
22VancouverNorth Vancouver2
23North VancouverNorth Vancouver1
Sheet2
Cell Formulas
RangeFormula
C21:C23C21=INDEX($A$1:$Q$17,MATCH(A21,$A$2:$A$17,0),MATCH(B21,$B$1:$Q$1,0))
 
Upvote 0
If you are using your 365 version & it is of interest to you, Alan's suggestion can be modified to return all the results from a single formula without the need to copy it down (& then none of the '$' anchors would be required either)

25 03 06.xlsm
ABCDEFGHIJKLMNOPQ
1BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouverWest VancouverWhite Rock
2Burnaby1222212222222222
3Coquitlam2122123111322332
4Delta2211223222111331
5Langley2211223222311331
6Maple Ridge2122123111322332
7New Westminster1222212222222222
8North Vancouver2333321333233213
9Pitt Meadows2122123111322332
10Port Coquitlam2122123111322332
11Port Moody2122123111322332
12Richmond2313322333131223
13Surrey2211223222311331
14Tsawwassen2211223222111331
15Vancouver2333322333233123
16West Vancouver2333321333233213
17White Rock2211223222311331
18
19
20UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
21VancouverVancouver1
22VancouverNorth Vancouver2
23North VancouverNorth Vancouver1
Zones
Cell Formulas
RangeFormula
C21:C23C21=INDEX(A1:Q17,MATCH(A21:A23,A2:A17,0),MATCH(B21:B23,B1:Q1,0))
Dynamic array formulas.
 
Upvote 0
Book8
ABCDEFGHIJKLMNOPQ
1BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouverWest VancouverWhite Rock
2Burnaby1222212222222222
3Coquitlam2122123111322332
4Delta2211223222111331
5Langley2211223222311331
6Maple Ridge2122123111322332
7New Westminster1222212222222222
8North Vancouver2333321333233213
9Pitt Meadows2122123111322332
10Port Coquitlam2122123111322332
11Port Moody2122123111322332
12Richmond2313322333131223
13Surrey2211223222311331
14Tsawwassen2211223222111331
15Vancouver2333322333233123
16West Vancouver2333321333233213
17White Rock2211223222311331
18
19
20UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
21VancouverVancouver1
22VancouverNorth Vancouver2
23North VancouverNorth Vancouver1
Sheet2
Cell Formulas
RangeFormula
C21:C23C21=INDEX($A$1:$Q$17,MATCH(A21,$A$2:$A$17,0),MATCH(B21,$B$1:$Q$1,0))
Thank you!

I coped the formula and everything seems to work except for when I try to enter Burnaby it returns the city listed beside it.

BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouver West VancouverWhite Rock
Burnaby1222212222222222
Coquitlam2122123111322332
Delta2211223222111331
Langley2211223222311331
Maple Ridge2122123111322332
New Westminster1222212222222222
North Vancouver2333321333233213
Pitt Meadows2122123111322332
Port Coquitlam2122123111322332
Port Moody2122123111322332
Richmond2313322333131223
Surrey2211223222311331
Tsawwassen2211223222111331
Vancouver 2333322333233123
West Vancouver2333321333233213
White Rock 2211223222311331
UPDATED HOME CITYEMPL_WORK_CITYQualifed Zones
BurnabyCoquitlamBurnaby
BurnabyDeltaCoquitlam
BurnabyLangleyDelta
BurnabyMaple RidgeLangley
BurnabyNew WestminsterMaple Ridge
BurnabyNorth VancouverNew Westminster
BurnabyPitt MeadowsNorth Vancouver
BurnabyPort CoquitlamPitt Meadows
BurnabyPort MoodyPort Coquitlam
BurnabyRichmondPort Moody
BurnabySurreyRichmond
BurnabyTsawwassenSurrey
BurnabyVancouver Tsawwassen
BurnabyWest VancouverVancouver
BurnabyWhite Rock West Vancouver
DeltaCoquitlam2
DeltaDelta1
DeltaBurnabyCoquitlam
DeltaCoquitlam2
DeltaDelta1
DeltaLangley2
DeltaMaple Ridge2
DeltaNew Westminster1
DeltaNorth Vancouver2
DeltaPitt Meadows3
DeltaPort Coquitlam1
DeltaPort Moody1
DeltaRichmond1
DeltaSurrey3
DeltaTsawwassen2
DeltaVancouver 2
DeltaWest Vancouver3
DeltaWhite Rock 3
LangleyCoquitlam2
LangleyDelta2
LangleyBurnabyDelta
LangleyCoquitlam2
LangleyDelta2
LangleyLangley1
LangleyMaple Ridge1
LangleyNew Westminster2
LangleyNorth Vancouver2
LangleyPitt Meadows3
LangleyPort Coquitlam2
LangleyPort Moody2
LangleyRichmond2
LangleySurrey1
LangleyTsawwassen1
LangleyVancouver 1
LangleyWest Vancouver3
LangleyWhite Rock 3
LangleyDelta2
White Rock New Westminster3
White Rock North Vancouver2
White Rock Pitt Meadows1
White Rock Port Coquitlam3
White Rock Port Moody3
White Rock Richmond3
White Rock Surrey2
White Rock Tsawwassen3
White Rock Vancouver 3
White Rock West Vancouver2
White Rock White Rock 1
 
Upvote 0
If you are using your 365 version & it is of interest to you, Alan's suggestion can be modified to return all the results from a single formula without the need to copy it down (& then none of the '$' anchors would be required either)

25 03 06.xlsm
ABCDEFGHIJKLMNOPQ
1BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouverWest VancouverWhite Rock
2Burnaby1222212222222222
3Coquitlam2122123111322332
4Delta2211223222111331
5Langley2211223222311331
6Maple Ridge2122123111322332
7New Westminster1222212222222222
8North Vancouver2333321333233213
9Pitt Meadows2122123111322332
10Port Coquitlam2122123111322332
11Port Moody2122123111322332
12Richmond2313322333131223
13Surrey2211223222311331
14Tsawwassen2211223222111331
15Vancouver2333322333233123
16West Vancouver2333321333233213
17White Rock2211223222311331
18
19
20UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
21VancouverVancouver1
22VancouverNorth Vancouver2
23North VancouverNorth Vancouver1
Zones
Cell Formulas
RangeFormula
C21:C23C21=INDEX(A1:Q17,MATCH(A21:A23,A2:A17,0),MATCH(B21:B23,B1:Q1,0))
Dynamic array formulas.
Thank you, unfortunately my version doesn't seem to support this.
 
Upvote 0
except for when I try to enter Burnaby it returns the city listed beside it.
Yes, there are a couple of small glitches in the formula references. Try this correction to the original formula - or the VLOOKUP alternative provided beside.

25 03 06.xlsm
ABCDEFGHIJKLMNOPQ
1BurnabyCoquitlamDeltaLangleyMaple RidgeNew WestminsterNorth VancouverPitt MeadowsPort CoquitlamPort MoodyRichmondSurreyTsawwassenVancouverWest VancouverWhite Rock
2Burnaby1222212222222222
3Coquitlam2122123111322332
4Delta2211223222111331
5Langley2211223222311331
6Maple Ridge2122123111322332
7New Westminster1222212222222222
8North Vancouver2333321333233213
9Pitt Meadows2122123111322332
10Port Coquitlam2122123111322332
11Port Moody2122123111322332
12Richmond2313322333131223
13Surrey2211223222311331
14Tsawwassen2211223222111331
15Vancouver2333322333233123
16West Vancouver2333321333233213
17White Rock2211223222311331
18
19
20UPDATED HOME CITYEMPL_WORK_CITYQualified Zones
21BurnabyCoquitlam22
22BurnabyDelta22
23BurnabyLangley22
24BurnabyMaple Ridge22
25BurnabyNew Westminster11
26BurnabyNorth Vancouver22
27BurnabyPitt Meadows22
28BurnabyPort Coquitlam22
29BurnabyPort Moody22
30BurnabyRichmond22
31BurnabySurrey22
32BurnabyTsawwassen22
33BurnabyVancouver22
34BurnabyWest Vancouver22
35BurnabyWhite Rock22
36DeltaCoquitlam22
37DeltaDelta11
38DeltaBurnaby22
39DeltaCoquitlam22
40DeltaDelta11
41DeltaLangley11
42DeltaMaple Ridge22
43DeltaNew Westminster22
44DeltaNorth Vancouver33
45DeltaPitt Meadows22
46DeltaPort Coquitlam22
47DeltaPort Moody22
48DeltaRichmond11
49DeltaSurrey11
50DeltaTsawwassen11
51DeltaVancouver33
52DeltaWest Vancouver33
53DeltaWhite Rock11
54LangleyCoquitlam22
55LangleyDelta11
56LangleyBurnaby22
57LangleyCoquitlam22
58LangleyDelta11
59LangleyLangley11
60LangleyMaple Ridge22
61LangleyNew Westminster22
62LangleyNorth Vancouver33
63LangleyPitt Meadows22
64LangleyPort Coquitlam22
65LangleyPort Moody22
66LangleyRichmond33
67LangleySurrey11
68LangleyTsawwassen11
69LangleyVancouver33
70LangleyWest Vancouver33
71LangleyWhite Rock11
72LangleyDelta11
73White RockNew Westminster22
74White RockNorth Vancouver33
75White RockPitt Meadows22
76White RockPort Coquitlam22
77White RockPort Moody22
78White RockRichmond33
79White RockSurrey11
80White RockTsawwassen11
81White RockVancouver33
82White RockWest Vancouver33
83White RockWhite Rock11
Zones
Cell Formulas
RangeFormula
C21:C83C21=INDEX(B$2:Q$17,MATCH(A21,A$2:A$17,0),MATCH(B21,B$1:Q$1,0))
D21:D83D21=VLOOKUP(A21,A$2:Q$17,MATCH(B21,A$1:Q$1,0),0)
 
Upvote 0

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