• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data Validation - Two digits to the right of the decimal or less (Solved)

I'm trying to restrict entries so that if somebody enters 3 digits or more to the right of the decimal point, they will be flagged for an error.

The formula below will work only if a decimal point is entered, but if a whole number is entered this will not work or if I enter a number with a zero after the decimal, e.g. 48.0 that won't work either. I am trying to find a solution that can accommodate these two exceptions.

Code:
=FIND(".",A1,1)>=LEN(A1)-2

In the attached file, in column H, I have some examples of how a number might be entered and whether or not the data validation should accept the entry (column I).

Is it possible to handle a whole number entered w/o a decimal as well as a number entered with a zero after the decimal?
 

Attachments

  • Chandoo.org - Data Validation - Restricting Decimal Places.xlsx
    9 KB · Views: 3
Back
Top