I am trying to write a custom validation formula to require the following conditions for Cell O22 on a spreadsheet:
- Value must be a number
- Value cannot be zero
- Value must be greater than or equal to 0.001
- Value must be greater than the cell to the right
In the example, O22 is the gross weight for an object and P22 is the net weight, so both will be numbers.
So I plug in the following formula to a custom data validation box:
=AND(ISNUMBER(O22), O22<>0, O22>0.001, O22>P22)
However, when I go to enter in an invalid value such as the letter "A", no error message appears. I can put the exact same formula into another cell and it will evaluate as false, because "A" is not a number.
After building the formula out one condition at a time, everything works correctly until I add the O22>P22 test. This is when it starts accepting any value without error. Can anyone suggest a workaround for this?
022<>0is redundant as you also state022>0.001which will test false if the value is zero. I would try @xidgel answer. That way you will know if the value is being stored an non-numerical which it probably is if its not working for you. - bbishopcaP22=""to the AND function tests as well as trying this on a blank spreadsheet in case something was corrupted with the original, but no change. If P22 is empty, I can enter whatever value I want into O22. If P22 has a value, O22's data validation will work as expected. - Aerogems