+ Reply to Thread
Results 1 to 13 of 13

How to set 2 decimal places to the right a certain number?

  1. #1
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    How to set 2 decimal places to the right a certain number?

    I have this data:
    Price
    11.99000000
    8.35000000
    71.99000000
    7.99000000
    1.00000000
    10.00000000
    10.00000000


    I need to set two decimal places to the right the # 1.
    So the result should be, from my example data:
    11.91000000
    8.31000000
    71.91000000
    7.91000000
    1.01000000
    10.01000000
    10.01000000

    Any nudge is greatly appreciated!

    Thanks,
    Chef

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to set 2 decimal places to the right a certain number?

    If the original number is in A1, this formula will make the change:

    =(INT(A1*10)+0.1)/10

    Use the same formatting as your original number.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Re: How to set 2 decimal places to the right a certain number?

    I will test this, thank for the fast response.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: How to set 2 decimal places to the right a certain number?

    Are these real numbers, or text that look like numbers??? What formatting is applied to the cells?


    You could try this...

    =IF(ISNUMBER(SEARCH(".",A1)),LEFT(A1,LEN(A1)-1)+0.01,A1+0.01)

    If that's not it, post some actual data - in an excel sheet.

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Re: How to set 2 decimal places to the right a certain number?

    Here is 30 rows of sample data. I need the Price column edited with 13.01 (as an example)

    Thanks again, everyone.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: How to set 2 decimal places to the right a certain number?

    Not only did I horrendously overcomplicate this... I got it wrong, too!! I assumed (incorrectly) that they were numbers formatted to a large number of dps. C'est la Vie.

  7. #7
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Re: How to set 2 decimal places to the right a certain number?

    This is POS (Point of Sale) data and the data is formatted like that in the Inventory table in the POS. FYI

  8. #8
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Re: How to set 2 decimal places to the right a certain number?

    Quote Originally Posted by Glenn Kennedy View Post
    Not only did I horrendously over-complicate this... I got it wrong, too!!
    Do tell. What do you mean?

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to set 2 decimal places to the right a certain number?

    Here is with MOD
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by AlKey; 09-22-2017 at 01:31 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: How to set 2 decimal places to the right a certain number?

    Try my formula in you sheet. I assumed that you were working with real numbers, not text that looks like numbers. Had they been numbers, it would have been overly complicated, but did work (as per my sheet). However, being text, that LOOKS like a number, it delivered totally incorrect answers.

    6SJ got it spot-on.

  11. #11
    Registered User
    Join Date
    03-22-2017
    Location
    Westlake Village, CA
    MS-Off Ver
    2016
    Posts
    24

    Re: How to set 2 decimal places to the right a certain number?

    Quote Originally Posted by Glenn Kennedy View Post
    Try my formula in you sheet. I assumed that you were working with real numbers, not text that looks like numbers. Had they been numbers, it would have been overly complicated, but did work (as per my sheet). However, being text, that LOOKS like a number, it delivered totally incorrect answers.

    6SJ got it spot-on.
    My sheets, all rows/columns are set to TEXT. They have to be or the data is incorrectly formatted when I paste it in from SQL. In addition, when I upload this back into the POS Software, it must be in text/csv format.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: How to set 2 decimal places to the right a certain number?

    Yea. That's what you have... But it wasn't clear from the first post, which is why I went off in the wrong direction. As I said, 6SJ's formula is fine.

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to set 2 decimal places to the right a certain number?

    Here is if you want this as TEXT
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Adusting decimal places based on greatest number of places in a series
    By anelson87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2022, 01:05 PM
  2. [SOLVED] Need to limit the number of decimal places of a number in a text string
    By Turbo Dog in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-11-2013, 07:47 PM
  3. [SOLVED] copy number with 3 or more decimal places and paste the actual value as 2 decimal number
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2013, 12:57 AM
  4. Vba to format number of decimal places dependant on number in another cell
    By wonderdunder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2012, 09:33 AM
  5. number of decimal places
    By Geordie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2010, 03:06 AM
  6. Paste two decimal number in excel without extra decimal places appearing
    By jeffery_frick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2009, 07:49 PM
  7. Converting a number to 2 decimal places
    By mattslav in forum Excel General
    Replies: 2
    Last Post: 06-03-2005, 11:10 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