formula to input city and output area code

brennagcollins

New Member
Joined
Jun 20, 2014
Messages
6
I have a list of area codes and match up with cities listed as such:

column K: area codes
column L: cities
column C: where im entering the city manually for each client


What I am wonder is how to type a city into column C and have it sift through my areacode/city table and output the area code that matches into a new column.

I have tried lookup formulas (=LOOKUP(C:C,L:L,K:K) and it just isnt working exactly how i need it to as it isnt matching the city properly.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Here i assumed you are looking for the area code of the City you have typed in C1

use =INDEX($K:$L,MATCH(C1,$L:$L,0),1) wherever you want the area code returned
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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