Custom Number Formats (Multiply & Divide by any Power of 10)

Share

Facebook
Twitter
LinkedIn

In the past here at Chandoo.org and at many many other sites, people have asked the question “How can I display a number Multiplied or Divided by 10, 100, 1000, 1000000 etc, but still have the cell maintain the original number for use in subsequent calculations“.

Typically the answer has been limited to “It can’t be done” or “It can only be done in multiples of 1000”.

Well thanks to a tip I picked up from Kyle who responded to a post here at Chandoo.org they are all wrong.

It is possible to Multiply or Divide any cell contents by any power of 10 using Custom Number Formats !

That is:

How does this work:

When using custom number format we have two possibilities to modify the display number

  1. Use a Comma to divide by 1000; or
  2. Use a % to Multiply by 100

So using a combination of these any power of 10 can be obtained.

So using the correct combination of , and % can result in any power of 10 multiplier we require.

The problem is that using a % adds a % to the number!

The trick which Kyle added is that adding a Ctrl J to the Custom Number format allows us to hide the % signs on a second row of text, then by adjusting the cell to have word wrap and adjusting the row height the second row is not visible.

The Ctrl J must be added after the ,’s and before the %’s

So using the examples above the table is:

The Ctrl J adds a Carriage Return, chr(10), to the Format String.

Finally after applying the Custom Number Format the Cell must be edited to enable Word Wrap.

Select the Cells with the custom Formats, Ctrl 1, Alignment

 

You can see the hidden % symbols if you increase the Row Height.

 

Combination with Regular Custom Formats

These Custom Number Formats can of course still be combined with regular Custom Number Formats, just make sure that the Ctrl J is inserted before the % signs:

No Loss of the Cells Value

It is also worth noting that the original number is still maintained internally in the cell and that cells dependent on the cells don’t have to adjust for the display value.

 

Multi Line Formats

By extension we can now use this technique to add multiple Lines of Text to a Custom Number Format

 

Downloads

You can download a file containing all the above example here: Download Here

 

Other Links to Custom Number Formats

Here:

http://chandoo.org/wp/2008/02/25/custom-cell-formatting-in-excel-few-tips-tricks/

http://chandoo.org/wp/2011/11/02/a-technique-to-quickly-develop-custom-number-formats/

http://chandoo.org/wp/2011/08/19/selective-chart-axis-formating/

http://chandoo.org/wp/2011/08/22/custom-chart-axis-formating-part-2/

http://chandoo.org/wp/tag/custom-cell-formatting/

Elsewhere

http://www.ozgrid.com/Excel/CustomFormats.htm

http://peltiertech.com/Excel/NumberFormats.html

 

Thanx

Just a quick final Thank You to Kyle for highlighting this Custom Number Format feature/trick last week

I look forward to your comments below:

 

 

 

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

One Response to “How to compare two Excel sheets using VLOOKUP? [FREE Template]”

  1. Danny says:

    Maybe I missed it, but this method doesn't include data from James that isn't contained in Sara's data.

    I added a new sheet, and named the ranges for Sara and James.

    Maybe something like:
    B2: =SORT(UNIQUE(VSTACK(SaraCust, JamesCust)))
    C2: =XLOOKUP(B2#,SaraCust,SaraPaid,"Missing")
    D2: =XLOOKUP(B2#,JamesCust, JamesPaid,"Missing")
    E2: =IF(ISERROR(C2#+D2#),"Missing",IF(C2#=D2#,"Yes","No"))

    Then we can still do similar conditional formatting. But this will pull in data missing from Sara's sheet as well.

Leave a Reply