Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 500m, 500b, 500t, function?


Hi all,

sorry if this has already been posted before but I am looking for
user defined formula (if this doesn't already exist within Excel'
formulas) that will take a number and output it with a suffix of a 'm
for millions, 'b' for billions, 't' for trillions, etc.

So if the functions took a number like this: 104,856,000 I would lik
it to round it to the nearest million and output 105m or also if I ca
get it to display 104.86m

Can someone please point me in the right direction?

Many thanks,
Ton

--
Ton
-----------------------------------------------------------------------
Tone's Profile: http://www.excelforum.com/member.php...fo&userid=2535
View this thread: http://www.excelforum.com/showthread.php?threadid=48978

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 500m, 500b, 500t, function?

One way:

Function NumChar(a As Double) As String
Select Case a
Case Is = 1000000000000#
NumChar = Format(a / 1000000000000#, "0.00") + "t"
Case Is = 1000000000
NumChar = Format(a / 1000000000, "0.00") + "b"
Case Is = 1000000
NumChar = Format(a / 1000000, "0.00") + "m"
Case Else
NumChar = Format(a, "0.00")
End Select
End Function


--
Kind regards,

Niek Otten

"Tone" wrote in message
...

Hi all,

sorry if this has already been posted before but I am looking for a
user defined formula (if this doesn't already exist within Excel's
formulas) that will take a number and output it with a suffix of a 'm'
for millions, 'b' for billions, 't' for trillions, etc.

So if the functions took a number like this: 104,856,000 I would like
it to round it to the nearest million and output 105m or also if I can
get it to display 104.86m

Can someone please point me in the right direction?

Many thanks,
Tony


--
Tone
------------------------------------------------------------------------
Tone's Profile:
http://www.excelforum.com/member.php...o&userid=25356
View this thread: http://www.excelforum.com/showthread...hreadid=489788



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 500m, 500b, 500t, function?


Thank you!


--
Tone
------------------------------------------------------------------------
Tone's Profile: http://www.excelforum.com/member.php...o&userid=25356
View this thread: http://www.excelforum.com/showthread...hreadid=489788

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 500m, 500b, 500t, function?

You could also use a custom format of

[1000000000]#,##0,,,"t";[1000000]#,##0,,"m";General

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Niek Otten" wrote in message
...
One way:

Function NumChar(a As Double) As String
Select Case a
Case Is = 1000000000000#
NumChar = Format(a / 1000000000000#, "0.00") + "t"
Case Is = 1000000000
NumChar = Format(a / 1000000000, "0.00") + "b"
Case Is = 1000000
NumChar = Format(a / 1000000, "0.00") + "m"
Case Else
NumChar = Format(a, "0.00")
End Select
End Function


--
Kind regards,

Niek Otten

"Tone" wrote in

message
...

Hi all,

sorry if this has already been posted before but I am looking for a
user defined formula (if this doesn't already exist within Excel's
formulas) that will take a number and output it with a suffix of a 'm'
for millions, 'b' for billions, 't' for trillions, etc.

So if the functions took a number like this: 104,856,000 I would like
it to round it to the nearest million and output 105m or also if I can
get it to display 104.86m

Can someone please point me in the right direction?

Many thanks,
Tony


--
Tone
------------------------------------------------------------------------
Tone's Profile:
http://www.excelforum.com/member.php...o&userid=25356
View this thread:

http://www.excelforum.com/showthread...hreadid=489788





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 500m, 500b, 500t, function?

Yes, and that way you could still calculate with them!

--
Kind regards,

Niek Otten

"Bob Phillips" wrote in message
...
You could also use a custom format of

[1000000000]#,##0,,,"t";[1000000]#,##0,,"m";General

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Niek Otten" wrote in message
...
One way:

Function NumChar(a As Double) As String
Select Case a
Case Is = 1000000000000#
NumChar = Format(a / 1000000000000#, "0.00") + "t"
Case Is = 1000000000
NumChar = Format(a / 1000000000, "0.00") + "b"
Case Is = 1000000
NumChar = Format(a / 1000000, "0.00") + "m"
Case Else
NumChar = Format(a, "0.00")
End Select
End Function


--
Kind regards,

Niek Otten

"Tone" wrote in

message
...

Hi all,

sorry if this has already been posted before but I am looking for a
user defined formula (if this doesn't already exist within Excel's
formulas) that will take a number and output it with a suffix of a 'm'
for millions, 'b' for billions, 't' for trillions, etc.

So if the functions took a number like this: 104,856,000 I would like
it to round it to the nearest million and output 105m or also if I can
get it to display 104.86m

Can someone please point me in the right direction?

Many thanks,
Tony


--
Tone
------------------------------------------------------------------------
Tone's Profile:
http://www.excelforum.com/member.php...o&userid=25356
View this thread:

http://www.excelforum.com/showthread...hreadid=489788







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 Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
Custom Format as Currency with If/Then ($1B or $500M) [email protected] New Users to Excel 2 May 14th 08 02:46 AM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


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