+ Reply to Thread
Results 1 to 10 of 10

Thousands as K, Millions as M, Billions as B

  1. #1
    Registered User
    Join Date
    12-12-2014
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    43

    Thousands as K, Millions as M, Billions as B

    In excel I want to specify a custom format that will display thousands as "k", millions as "M", and billions as "B", for positive and negative values. All at the same time. For example

    $4,100 -> $4.1 k
    -$1,200,000 -> -$1.2 M
    $3,800,000,000 -> $3.8 B

    I have found ways to do this for just millions or just thousands, but no way to combine all formats. In addition no tutorials tell how to deal with the negative numbers. Is this possible without dipping into VBA?
    Last edited by TestMailinator; 01-29-2015 at 02:36 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Thousands as K, Millions as M, Billions as B

    Hi TestMailinator,

    I hate to point you to some other site, but I think you should read the answer at:
    http://www.mrexcel.com/forum/excel-q...ormatting.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,534

    Re: Thousands as K, Millions as M, Billions as B

    well, if you have essentially fixed values, thousands, millions, billions this would work w/o vba...
    =IF(LEN(A1)=4,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,3),1)&"k",IF(LEN(A1)=7,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,6),1)&"M",IF(LEN(A1)=10,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,9),1)&"B"))) But if you get into tens of thousands and hundreds of thousands tens of millions then setting up a reference table would be better.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Thousands as K, Millions as M, Billions as B

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,534

    Re: Thousands as K, Millions as M, Billions as B

    here is a tweek that would work if you have thousands up to hundreds of billions.
    BUT it relies on putting a formula for length in another column, in this case cell D1 =LEN(A1)
    Then referring to that, this in another cell...
    =IF(D1=4,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,3),1)&"k",IF(D1=5,"$"&LEFT(A1,2)&"."&LEFT(RIGHT(A1,3),1)&"k",IF(D1=6,"$"&LEFT(A1,3)&"."&LEFT(RIGHT(A1,3),1)&"k",IF(D1=7,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,6),1)&"M",IF(D1=8,"$"&LEFT(A1,2)&"."&LEFT(RIGHT(A1,6),1)&"M",IF(D1=9,"$"&LEFT(A1,3)&"."&LEFT(RIGHT(A1,6),1)&"M",IF(D1=10,"$"&LEFT(A1,1)&"."&LEFT(RIGHT(A1,9),1)&"B",IF(D1=11,"$"&LEFT(A1,2)&"."&LEFT(RIGHT(A1,9),1)&"B",IF(D1=12,"$"&LEFT(A1,3)&"."&LEFT(RIGHT(A1,9),1)&"B")))))))))

  6. #6
    Registered User
    Join Date
    12-12-2014
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    43

    Re: Thousands as K, Millions as M, Billions as B

    Awesome! That works. And no VBA

    For general reference this tutorial is also helpful... it explains the basics of Excel number formatting

    http://www.mbaexcel.com/excel/how-to...er-formatting/

  7. #7
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Thousands as K, Millions as M, Billions as B

    Other than Marvin I think we've all gone off on a tangent, the OP was looking for a custom format not formula

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,534

    Re: Thousands as K, Millions as M, Billions as B

    PJW, you're right, I concentrated more on not "VBA" than I did on the formatting issue. Of course I did look initially at formatting and didn't see it as a possibility offhand.
    BUT I had fun trying to get the formula to work so... even if TestMailinator doesn't want it, it was fun developing it.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Thousands as K, Millions as M, Billions as B

    Row\Col
    A
    B
    C
    1
    4,100
    4.1 K
    B1: =A1
    2
    -1,200,000
    -1.2 M
    3
    3,800,000,000
    3.8 B


    Three conditional formatting rules:

    =ABS(Me)>1000 format as 0.0 K

    =ABS(Me)>1000000 format as 0.0,, \M

    =ABS(Me)>1000000000 format as 0.0,,, \B

    Replace Me with the address of the cell.
    Entia non sunt multiplicanda sine necessitate

  10. #10
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Thousands as K, Millions as M, Billions as B

    Quote Originally Posted by Sambo kid View Post
    PJW, you're right, I concentrated more on not "VBA" than I did on the formatting issue. Of course I did look initially at formatting and didn't see it as a possibility offhand.
    BUT I had fun trying to get the formula to work so... even if TestMailinator doesn't want it, it was fun developing it.
    yeah, I did the same!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel data all in thousands, I want it in millions
    By davidx in forum Excel General
    Replies: 4
    Last Post: 01-08-2015, 09:06 AM
  2. [SOLVED] Need help with formating numbers in thousands and millions
    By Ninjja in forum Excel General
    Replies: 13
    Last Post: 10-09-2013, 07:02 AM
  3. Excel 2007 : Number format for millions and billions
    By bruiser in forum Excel General
    Replies: 1
    Last Post: 06-14-2011, 02:49 AM
  4. Can I rounddown a cell result from millions to thousands
    By R Champ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  5. Can I rounddown a cell result from millions to thousands
    By R Champ in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1