# formula question

#### Bub_the_Zombie

##### Board Regular
trying to make a formula that writes "out" in a cell if it reads an X in a different cell.

If M7 = x, then D7 = OUT

I was trying to convert an example from online to fit my needs, but no luck. Been googling around for about an hour, giving up and putting my request to the mercy of the boards. Can someone please show me how to write this please.

Was trying to convert this.

=IF(ISNUMBER(SEARCH("abc",B5)),B5,"")

=IF(ISNUMBER(SEARCH("X",M7)),D7,"OUT")

Any help appreciated.

### Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

#### Marcílio_Lobão

##### Well-known Member
Bub_the_Zombie, Good evening.

Try to use:

D7 --> =IF(ISNUMBER(SEARCH("X",M7)), M7, "OUT")

Is that what you want?
I hope it helps.

#### FDibbins

##### Well-known Member
will X be the only contents of that cell, or will there be a string that may - or may not - contain X?

If there will ONLY be X in the cell...

=if(M7="x","OUT","")

#### Bub_the_Zombie

##### Board Regular
Two things.

It is not going in as a formula, staying as the text. What am I doing wrong?

I am noticing that I need to adjust it to

If M7=X is true, Then "OUT"
If M7 does not =x then copy N7 contents

Could you help me phrase that.

#### FDibbins

##### Well-known Member
Two things.

It is not going in as a formula, staying as the text. What am I doing wrong?
check that the cell is formatted as TEXT - if to, format to general, then press F2 and enter
I am noticing that I need to adjust it to

If M7=X is true, Then "OUT"
If M7 does not =x then copy N7 contents

Could you help me phrase that.
If I had that the wrong way round...
=if(M7="x","OUT",N7)

#### Bub_the_Zombie

##### Board Regular
Awesome!

It was set to TEXT, that fixed it.

The second code works great!

Thanks!

#### FDibbins

##### Well-known Member
Great, happy to help

Replies
5
Views
277
Replies
3
Views
1K
Replies
11
Views
464
Replies
6
Views
222
Replies
3
Views
306

1,191,718
Messages
5,988,272
Members
440,146
Latest member
rgomes8

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back