MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Data Validation Problem

Posted by Mark F. on September 13, 2001 12:53 PM

I need a way to display an error message to the user if they enter a number with more than 4 decimal places. I have been trying to use the Custom setting in the Data Validation with the following formula:

=IF(FIND(".", E77) > 0, IF(LEN(RIGHT(E77, (LEN(E77) - FIND(".", E77)))) > 4, 0, 1), E77)

This works if the number contains a decimal, but if the user enters 1 (with no decimal) it fails. Any help would be appreciated.

Posted by IML on September 13, 2001 1:09 PM

Try the following (assuming cell A1 for validation)

good luck

Posted by Mark F on September 14, 2001 5:05 AM

Thanks, that worked great.

Posted by Mark W. on September 14, 2001 7:38 AM

Yet, another way...