# Formula condition help

#### CRAIG20

##### Board Regular
Hi, I have a formula in B1

=INDEX(\$E\$12:\$E\$40,MATCH(A53,\$F\$12:\$F\$40,0),1)

However I would like to only apply this formula if cell A1 contains the letter M. If it doesn't then I would like it to simply enter a '-' hyphen in the cell.

Can this be done?

Thanks

### Excel Facts

Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

#### VoG

##### Legend
Try

=IF(ISNUMBER(SEARCH("m",A1)),INDEX(\$E\$12:\$E\$40,MATCH(A53,\$F\$12:\$F\$40,0),1),"-")

Great

Thanks!

Replies
3
Views
102
Replies
1
Views
306
Replies
11
Views
786
Replies
3
Views
313
Replies
3
Views
258

1,191,555
Messages
5,987,260
Members
440,087
Latest member
Ruppert23

### 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