+ Reply to Thread
Results 1 to 4 of 4

Check if the number have two decimal point

  1. #1
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Check if the number have two decimal point

    Good day guys! I have a problem with the values contains two decimal point:

    sample:

    a1 -> 2.333.33 "i want this to return as 2,333.33"

    a2 -> 33.33 "i want this to retun 33.33"

    a3 -> 45.555.55 "i want this to return 45,555.55"

    i already asked this question and someone gave me this code -> substitute(a1,".","",1) which return to 2333.33 but the problem is for the a2 if i use the code it will return as "3333" which read as "3,333". Is there any way that we can determine if the values have two decimal point before it will run the command?

    Thanks!
    Last edited by darkhangelsk; 08-20-2009 at 01:15 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Check if the number have two decimal point

    This equation should work
    Please Login or Register  to view this content.
    It also converts your string to a number so you can format it properly (e.g. with a comma or not) Does this work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Check if the number have two decimal point

    Try

    =IF(ISNUMBER(A1),A1,SUBSTITUTE(A1,".","",1)+0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: Check if the number have two decimal point

    yey! I think they're both working. Thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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