Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function to cnvrt Phone to State w/out cell ref

I am trying to write a function to convert a phone number to state..

Currenly I have using vlookup and it works fine. here is what Im usin
now...

=VLOOKUP(LEFT(A2,3)*1,State,2,FALSE)

State is a named range in a seperate sheet within the workbook.
A:A are phone numbers/account numbers like 2015552222

I would like to get rid of the sheet containing the cells i referenc
with vlookup and simply build a function with an array that contain
all area codes and the states they're in.

I also want to write another function that then converts states int
sales regions. West, Midwest, East, etc....

I have failed horribly at trying to do this... please help. What I
doing works now, but i want the functions so it is easier for other
not so good with excel to process the data we already have on thei
own.

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function to cnvrt Phone to State w/out cell ref

btt

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Function to cnvrt Phone to State w/out cell ref

No need to use VBA.
In cell B2, go Insert, Name, Define and in the refers to box type in:
=VLOOKUP(LEFT(A2,3)*1,State,2,FALSE)
Then in names in workbook type in a function name of your choice e.g.
actostate
Click OK
In cell B2, enter the formula =actostate
In cell C2, enter the formula =actostate, etc.
(Assumes that values in column to left of formula contain area code)

snflupigus < wrote:
I am trying to write a function to convert a phone number to state..

Currenly I have using vlookup and it works fine. here is what Im using
now...

=VLOOKUP(LEFT(A2,3)*1,State,2,FALSE)

State is a named range in a seperate sheet within the workbook.
A:A are phone numbers/account numbers like 2015552222

I would like to get rid of the sheet containing the cells i reference
with vlookup and simply build a function with an array that contains
all area codes and the states they're in.

I also want to write another function that then converts states into
sales regions. West, Midwest, East, etc....

I have failed horribly at trying to do this... please help. What Im
doing works now, but i want the functions so it is easier for others
not so good with excel to process the data we already have on their
own.

Thanks


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace state names with state code abbreviations se7098 Excel Worksheet Functions 3 July 25th 09 06:41 PM
Associating a STATE or TIME with a phone number charles770 Excel Worksheet Functions 5 August 27th 08 06:44 PM
How can I show state-by-state data (as silos) on a map of NA Rob Charts and Charting in Excel 0 November 5th 07 03:41 PM
auto fill state and city from phone number? Biz Excel Discussion (Misc queries) 2 November 18th 05 06:52 PM
How to convert phone area-code to state name and time zone NoYouShmoopie Excel Discussion (Misc queries) 2 October 7th 05 02:38 PM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"