![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Oct 2003
Location: Florida
Posts: 7
|
I am trying to upload a text file from another program that formats the telephone number as (xxx) xxx-xxxx and Excel keeps reading it as text rather than as a numeric value. I can't change the format no matter what I try. The end result I am trying to achieve is to load this file into access and compare the telephone number against another table. Access does not recognize the text format and does not see that the excel table numbers are equal.
Help! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Moderator Join Date: Aug 2002
Posts: 16,457
|
If you want just as a straight number, first do a Find & Replace to get rid of all parends, dashes, and spaces. Then format the column as General or Numbers. Then do a Text to Columns (from the Data drop down menu), switching the data to General format.
__________________
TIPS FOR FINDING EXCEL SOLUTIONS 1. Use the built-in Help that comes with Excel/Access 2. Use the Search functionality on this board 3. A lot of VBA code can be acquired by using the Macro Recorder. |
|
|
|
|
|
#3 |
|
Join Date: Jan 2003
Location: Round Rock, Texas
Posts: 564
|
Here's a formula solution, given your format structure of (xxx) xxx-xxxx:
=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"(",""),")","")," ",""),"-","") Ugly, but it works. Jmiskey's is probably a better approach, though. --Tom |
|
|
|
|
|
#4 |
|
Join Date: Oct 2003
Location: Florida
Posts: 7
|
That was so simple I feel really silly now! Thank you so much, you saved my poor aching head! Hope I can return the favor someday!
|
|
|
|
|
|
#5 |
|
Join Date: Jun 2003
Location: San Francisco Bay Area
Posts: 110
|
how about:
ph_num=val(mid(data,2,3) & mid(data,7,3) & mid(data,11,4)) where data = orginal data from file also all in coming data would have to be same format (xxx) xxx-xxxx
__________________
Shawn |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Moderator Join Date: May 2003
Location: Boulder Creek, CA
Posts: 20,903
|
Welcome to the Board!
Quote:
Smitty |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|