# Return TRUE if cell contains certain “x” or numbers

1. ## Return TRUE if cell contains certain “x” or numbers

Hi all,

I need a formula that returns TRUE if one of the following criteria is met in cell EG13:

cell contains e.g. "x", " x", "xx", "xxx", "5", "10" etc.

and returns FALSE

if the cell contains e.g. "Lux", "-2", "-8", “0”, "Fox” etc.

To put it into words, if the cell contains a positive number (excluding zero) or an “x” (maximum 5) while ignoring spaces but excluding words such as “Fox” it returns TRUE otherwise it returns FALSE. Below is the formula I currently have but it doesn’t seem to work...

2. ## Re: Return TRUE if cell contains certain “x” or numbers

Can you attach a sample spreadsheet with an example of your expected results?

3. ## Re: Return TRUE if cell contains certain “x” or numbers

Try this:

=OR(REPT("x",{1,2,3,4,5})=SUBSTITUTE(EG13," ",""),N(EG13)>0)

4. ## Re: Return TRUE if cell contains certain “x” or numbers

That does the job! Thanks!!

5. ## Re: Return TRUE if cell contains certain “x” or numbers

There are currently 1 users browsing this thread. (0 members and 1 guests)