Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel: Check if cell contains number in text string

Tags:

excel

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.

like image 511
Adam_G Avatar asked Mar 31 '15 16:03

Adam_G


People also ask

How do you check if a string contains a number in Excel?

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.

How do you check in Excel if a cell contains a value?

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", "").

How do you tell if a cell contains a number?

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.

Can you do an IF statement in Excel based on text?

Excel IF function with text Commonly, you write an IF statement for text values using either "equal to" or "not equal to" operator.


2 Answers

Similar to XOR LX's Answer but 2 chars shorter

=COUNT(FIND({0,1,2,3,4,5,6,7,8,9},A1))>0
like image 95
Steven Martin Avatar answered Nov 12 '22 18:11

Steven Martin


Not a very rigorous description, I'm afraid.

Perhaps:

=OR(COUNT(FIND({0,1,2,3,4,5,6,7,8,9},A1)))

Regards

like image 24
XOR LX Avatar answered Nov 12 '22 18:11

XOR LX