Reputation: 1618
I'm looking to try and do two separate types of validation.
Eg. Anything starting with A-Z case insensitive is fine.
I've got the number check working using =ISNUMBER(J1)
that seems to only allow numbers.
I'm trying to check the first character and have tried:
=ISTEXT(LEFT(B10,1))
but that doesn't seem to do what I was hoping..
Thanks
Upvotes: 1
Views: 194
Reputation: 35915
Checking if the whole cell is text is easy with just a simple formula, but if you want to check for only the first letter, then it's more involved.
To ensure that the first character is NOT a number, you can use the custom validation formula
=NOT(ISNUMBER(SUM(LEFT(A1,1),0)))
That will still allow special characters llike $
or &
etc. as the first character. If you only want to allow a-z and A-Z as the first letter, then use
=AND(CODE(LEFT(A1,1))>=56,CODE(LEFT(A1,1))<=122)
To allow only numbers, use the built in validation options for Decimal or Whole Number.
Upvotes: 1
Reputation: 19
For text only in a cell build a custom rule with the ISTEXT function, for example:
=ISTEXT(D2)
Custom rule for numbers only in a cell using ISNUMBER.
=ISNUMBER(D2)
Upvotes: 0