I have a worksheet with text strings in each cell (article title). I'd like to know if a cell contains a number. For example:
'This is 3' --> TRUE
'Red balloon' --> FALSE
' It's 10 things' --> TRUE
Update: Every answer on here works. I just chose the shortest and simplest.
The Excel ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not. You can use ISNUMBER to check that a cell contains a numeric value, or that the result of another function is a number. The Excel FIND function returns the position (as a number) of one text string inside another.
To check if a cell contains a number or date, select the output cell, and use the following formula: =IF(ISNUMBER(cell), value_to_return, ""). For our example, the cell we want to check is D2, and the return value will be Yes. In this scenario, you'd change the formula to =IF(ISNUMBER(D2), "Yes", "").
To test if a cell (or any text string) contains a number, you can use the FIND function together with the COUNT function. In the generic form of the formula (above), A1 represents the cell you are testing. The numbers to be checked (numbers between 0-9) are supplied as an array.
Excel IF function with text Commonly, you write an IF statement for text values using either "equal to" or "not equal to" operator.
Similar to XOR LX's Answer but 2 chars shorter
=COUNT(FIND({0,1,2,3,4,5,6,7,8,9},A1))>0
Not a very rigorous description, I'm afraid.
Perhaps:
=OR(COUNT(FIND({0,1,2,3,4,5,6,7,8,9},A1)))
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With