Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do you convert $100M into a whole number?

As above assuming it is possible. Have tried copy and special paste without
much luck so far.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default How do you convert $100M into a whole number?

Hi Jerry,

copy this code (press alt+f11) and use in an auxiliar column
=digitsonly(a2)

***********************************************
Public Function DigitsOnly(sStr As String) As Variant
Dim oRegExp As Object

Set oRegExp = CreateObject("VBScript.RegExp")

With oRegExp
.IgnoreCase = True
.Global = True
oRegExp.Pattern = "\D"

DigitsOnly = oRegExp.Replace(sStr, vbNullString)
End With
End Function
***********************************************

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Jerry Lee Penny" escreveu:

As above assuming it is possible. Have tried copy and special paste without
much luck so far.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default How do you convert $100M into a whole number?

Jerry Lee Penny wrote:
Subject: How do you convert $100M into a whole number?
As above assuming it is possible. Have tried copy and special paste without
much luck so far.


[Please repeat the question in the body of the posting.]

Do you mean that you have the text "$100M"? If so, does the following
meet your needs, assuming that A1 contains the text to convert:

1000000*mid(A1, 2, len(A1)-2)

More robust:

if(isnumber(A1), A1, if(right(A1,1)="M", 1000000*mid(A1,2,len(A1)-2),
if(right(A1,1)="K", 1000*mid(A1,2,len(A1)-2), 1*right(A1,len(A1)-1))))

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
Excel should have a formula to convert number into words Nitish Rawat Excel Worksheet Functions 1 December 21st 05 06:55 PM
How do I convert hh:mm:ss to an absolute number (26:01:32 to 26)? Fernando Excel Discussion (Misc queries) 1 December 1st 05 05:02 PM
Convert [h]:mm sum total format to number format Guy Excel Worksheet Functions 1 August 5th 05 05:56 AM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
"Convert to Number" option disappearing Mike Excel Discussion (Misc queries) 2 June 10th 05 04:11 PM


All times are GMT +1. The time now is 04:42 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"