Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
Custom Format as Currency with If/Then ($1B or $500M) | New Users to Excel | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Adding a custom function to the default excel function list | Excel Programming |