Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to test for integers or strings in a Google Spreadsheet and respond to each differently?

share|improve this question

migrated from superuser.com Feb 22 '11 at 11:08

This question came from our site for computer enthusiasts and power users.

Did you find any of the answers given useful? – Jacob Jan Tuinstra Mar 13 '14 at 11:07
up vote 6 down vote accepted

To test for string you can use =ISTEXT(A1)

To test for an Integer you will need to do something like this:

=IF( (D8 = int(D8)), TRUE, FALSE)

Which basically converts the value to an Integer and then checks if it is the same as the original pre-converted value.

share|improve this answer
I think =D8=int(D8) will do. (not tested) – wilson Feb 23 '11 at 8:23
@Wilson - Yes you are correct :) – codingbadger Feb 23 '11 at 9:07

You should be able to use the following function:


Which returns either TRUE or FALSE.

share|improve this answer
IsNumberwill return true for any number regardless of whether it is an int or a decimal e.g. 10 and 10.56 will both return true. – codingbadger Feb 22 '11 at 11:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.