+ Reply to Thread
Results 1 to 10 of 10

Customize number format

  1. #1
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Customize number format

    Hi,
    I'm trying to customize an integer to decimal, by formatting cells / column.

    Example: -725489639 to -7,25489639 and 388648957 to 38,8648957

    I have tried this ""0","00000000000000"" and ""00","00000000000000"" , but not always i have the same count of decimal numbers. the only fix numbers are the first one on longitude and the two first numbers on latitude.

    Someone can help me

    Thanks
    Attached Files Attached Files
    Last edited by Birnen; 12-04-2020 at 09:39 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Customize number format

    Birnen,

    What "makes" the first number -7.xxx but the second 38.xxxx when both are nine digits?

    Ochimus

  3. #3
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Customize number format

    Ochimus,

    The first number is the Longitude and the second the latitude (decimal coordinates).

  4. #4
    Registered User
    Join Date
    10-21-2020
    Location
    pakistan
    MS-Off Ver
    2013
    Posts
    18

    Re: Customize number format

    Try this

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Customize number format

    Thanks but doesn't work

    Attachment 707176

  6. #6
    Registered User
    Join Date
    10-21-2020
    Location
    pakistan
    MS-Off Ver
    2013
    Posts
    18

    Re: Customize number format

    Check this file. It works for me. Change the format of the cells. Make it to 8 decimal places.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Customize number format

    Hi,
    I'm trying to customize an integer to decimal, by formatting cells / column. not by formula, but thanks. I will save your file.

    Example: -725489639 to -7,25489639 and 388648957 to 38,8648957

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Customize number format

    When I was first learning Excel, this was one of my most frequently referenced help files: https://support.microsoft.com/en-us/...7-9c9354dd99f5

    If I understand your question, we may be able to take advantage of the limited conditional formatting options available in custom number formats. If your numbers will always be "larger" than 1E13, we could include two conditions in our custom number format
    Please Login or Register  to view this content.
    This works for up to three conditions, but will not allow more flexibility beyond that.

    When you say that you want to do this using formatting only, will you consider using conditional formatting? Excel's conditional formatting feature allows for much more complex formatting decisions. The concept is the same -- build a series of conditions based on the value of the number that assigns the appropriate number format code for the numbers magnitude. If you are unfamiliar with conditional formatting: https://www.excel-easy.com/data-****...ormatting.html
    Last edited by MrShorty; 12-04-2020 at 12:00 PM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Customize number format

    MrShorty,

    Problem is the numbers will not "always" be larger than 1E13.

    The solution needs to cope with Latitude varying in degrees from +90 for the Northern and -90 in the Southern hemisphere, and Longtitude varying from -180 to +180 West and East of the Prime Meridian at Greenwich.

    If you're sailing in the Gulf of Guinea you can actually be at 0,0!

    The other point is that although the values can go up to thirteen decimal places, most programme (e.g. Google Earth and Google Maps) usually work on 'one metre' resolution, which needs only five decimal places.

    Both of which suggest CF might not be a viable approach?

    Ochimus

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Customize number format

    The OP's examples are for Portugal only and are all 14 or 15 digit integers. You are correct that one could possibly need to handle all kinds of scenarios. Custom number formats can handle up to 3 conditions, so, if the OP's requirements are limited enough that he/she only needs up to three conditions to adequately describe his/her need, then custom number formatting can work.

    Regular conditional formatting, on the other hand, seems relatively unlimited. Other than it being a bit unwieldy, I see no reason one couldn't test for positive and negative numbers from 1 to 15 digits and any other special considerations.

    That said, rather than use formatting for something like, I would prefer a solution like rio.south proposed -- convert the integer to its actual decimal degree value rather than use formatting to make it look like a decimal degree value (but it is still a long integer behind the formatting). But the OP says he/she does not want the actual decimal degree value -- just wants it to look like a decimal degree value.

+ 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. Replies: 1
    Last Post: 02-06-2020, 03:36 AM
  2. Customize Number Cells
    By ng6971 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2015, 02:10 PM
  3. Replies: 6
    Last Post: 05-08-2014, 08:41 AM
  4. How to customize the Date format in Excel 2010?
    By Austin Brown in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-14-2013, 04:53 AM
  5. [SOLVED] customize number format/Display Text color
    By Jon_P in forum Excel General
    Replies: 7
    Last Post: 05-15-2012, 12:25 PM
  6. Replies: 1
    Last Post: 08-16-2006, 04:10 PM
  7. Replies: 1
    Last Post: 05-18-2006, 11:45 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