LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I changet a text telephone number (xxx) xxx-xxxx to xxxxxx.

Try this formula:

=VALUE(TRIM(CLEAN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(A1,"(",""),")",""),"-","")," ",""))))

or...

Save this function to your PERSONAL.xls file in a module:

Function KeepNumeric(Text As String) As String
Dim sTemp As String, i As Integer
sTemp = Text
For i = 1 To 255
If i < 48 Or i 57 Then
sTemp = Application.Substitute(sTemp, Chr(i), "")
End If
Next i
KeepNumeric = sTemp
End Function

Then enter the formula: =Value(KeepNumeric(A1))

That should do it!

Thanks,
Mike

"Bayou Johnny" wrote:

I have a data export that lists telephone number in a (xxx) xxx-xxxx format
that I need to change to a number format without spaces or commas. Anyone
know of a formula to apply to a column of text numbers to make such a
conversion within a spreadsheet?

 
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
Format a number (i.e. 1111111111111111) to show XXXX-XXXX-1111-11 rjbind Excel Discussion (Misc queries) 1 July 13th 07 03:45 AM
How do I delete dashes from a phone number xxx-xxx-xxxx in Excel? ARADER Excel Worksheet Functions 3 February 16th 07 06:19 PM
change dots to dashes in an account format (xx.xxxx.xxxx) to xx-xx Michael Excel Discussion (Misc queries) 1 July 1st 05 10:44 PM
Custom Format text XX:XXXX:XX mustard Excel Discussion (Misc queries) 1 February 17th 05 02:50 AM
Wrapped text appears as xxxxxx RegV Excel Discussion (Misc queries) 0 December 15th 04 03:43 PM


All times are GMT +1. The time now is 10:50 AM.

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"