A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Area Code part 3



 
 
Thread Tools Display Modes
  #1  
Old September 22nd, 2003, 08:57 PM
john c
external usenet poster
 
Posts: n/a
Default Area Code part 3

Thanks to everyone who helped me before, your suggestions
were perfect. I just need a little more help and i'll be
finished.

I now have a spreadsheet that can read a 9 digit phone
number, take the first three digits and spit out the US
State that corresponds to the three digit area code. I
have a list of every area code and it's State in columns A
and B.

Now what i need to do is when the area code is Texas, I
need the city along with the state. It is going to have
to read the first three digits to signal that it is Texas,
and then it's going to have to read the next 3 digits to
figure out the city. The formula I currently have for the
State lookup is =VLOOKUP(VALUE(LEFT(D1,3)),A:B,2,FALSE).

I need to add the Texas cities into my raw data, but how
can i get it so it recognizes the Texas area code and then
keeps reading the next three digits? Thanks guys
  #2  
Old September 24th, 2003, 10:55 PM
Tushar Mehta
external usenet poster
 
Posts: n/a
Default Area Code part 3

[This followup was posted to microsoft.public.excel.worksheet.functions
with an email copy to john c.
Please use the newsgroup for further discussion.]

OK, first of all, I'll assume you are working with 10 digit phone
numbers and not 9 as mentioned in your post.

Also, I'll assume the phone numbers are in col. F starting with F1.

Create a table with six digits (area code + exchange code) in column C
together with the city in column D. Now, use the untested formula
=VLOOKUP(VALUE(LEFT(F1,6)),C,2,FALSE).

Finally, if you store the city as 'city, state-abbreviation', you could
dispense with the state lookup altogether.

--
Trouble finding replies to your posts? Use a newsreader. See the
tutorial 'Outlook Express and Newsgroups' on my web site

Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , stratocaster9
@yahoo.com says...
Thanks to everyone who helped me before, your suggestions
were perfect. I just need a little more help and i'll be
finished.

I now have a spreadsheet that can read a 9 digit phone
number, take the first three digits and spit out the US
State that corresponds to the three digit area code. I
have a list of every area code and it's State in columns A
and B.

Now what i need to do is when the area code is Texas, I
need the city along with the state. It is going to have
to read the first three digits to signal that it is Texas,
and then it's going to have to read the next 3 digits to
figure out the city. The formula I currently have for the
State lookup is =VLOOKUP(VALUE(LEFT(D1,3)),A:B,2,FALSE).

I need to add the Texas cities into my raw data, but how
can i get it so it recognizes the Texas area code and then
keeps reading the next three digits? Thanks guys

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.