+ Reply to Thread
Results 1 to 7 of 7

how to give all numbers the same digit zeros on a sheet

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    how to give all numbers the same digit zeros on a sheet

    hi
    if i have a set of numbers on a row, the first in A1 is the base value lets say it's 0.0381 the others is differ from the base value in that it's digits are not the same after the comma (517 --- 719-----21.95833---4.2797-----0.08185337)
    how to make those numbers the same as the base value (0.0381) in term of digits value? like this
    0.0517
    0.0719
    0.0219583
    0.042747
    0.08185337
    Attached Files Attached Files
    Last edited by abdi1; 02-20-2021 at 01:44 PM.

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: how to give all numbers the same digit zeros on a sheet

    Hi abdi1:

    Is the base value always x.xxxx (4 decimal points?), or does the base value change depending on the values displayed in A1?

    Creating a custom format of 0.0000 will get your 4 decimals lined up.. ., but will that change; dependent what's shown in A1?



    Pete

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: how to give all numbers the same digit zeros on a sheet

    I have this working for the 1st bunch, just not figured out the value(s) that already contain the .0xxxx....
    =B1/10^(LEN(INT(B1))+IF(B1<1,0,1))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: how to give all numbers the same digit zeros on a sheet

    Quote Originally Posted by PeteABC123 View Post
    Hi abdi1:

    Is the base value always x.xxxx (4 decimal points?), or does the base value change depending on the values displayed in A1?

    Creating a custom format of 0.0000 will get your 4 decimals lined up.. ., but will that change; dependent what's shown in A1?



    Pete
    peteABC123...the base value change ...as will as all numbers in the row...so that the custom format will not solve the problem......thanks for you
    Last edited by abdi1; 02-20-2021 at 06:02 AM.

  5. #5
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: how to give all numbers the same digit zeros on a sheet

    Quote Originally Posted by FDibbins View Post
    =B1/10^(LEN(INT(B1))+IF(B1<1,0,1))
    thanks for you FDibbins...this forula works ..but what if the values in the row changed
    ??.. if i have 0.00381 or 0.000381 rather than 0.0381 .. also the values from B1 to H1 are not fixed...
    Last edited by abdi1; 02-20-2021 at 06:01 AM.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,597

    Re: how to give all numbers the same digit zeros on a sheet

    In A2 then copied across

    =VALUE("0.0"&VALUE(SUBSTITUTE(A1,".","")))
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: how to give all numbers the same digit zeros on a sheet

    Quote Originally Posted by kvsrinivasamurthy View Post
    =VALUE("0.0"&VALUE(SUBSTITUTE(A1,".","")))
    kvsrinivasamurthy....thanks for you.....this formula is brilliant ....problem solved

+ 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. [SOLVED] Extract 1, 2 or 3-digit Numbers from Text String but Ignore 4-Digit Dates
    By S_Rycroft in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-09-2020, 12:03 PM
  2. Replies: 1
    Last Post: 04-18-2019, 01:35 AM
  3. [SOLVED] Macro to convert WBS single digit numbers to double digit numbers
    By LeanAccountant in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-09-2018, 05:25 AM
  4. Bank Recon - How to convert 8 digit formatted check numbers to 6 digit
    By Quisp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2017, 09:55 PM
  5. [SOLVED] Changing 5-digit Zip to 3-digit zip without losing leading zeros
    By Jennifer C in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2014, 09:26 AM
  6. Extract 4 digit common numbers from 5 digit numbers
    By ameque in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2013, 01:09 AM
  7. [SOLVED] macro to extract 9 digit numbers as well as alpha numberic 9 digit numbers from txt file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2012, 10:15 AM

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