Isnumber search if

Simont485

Board Regular
Joined
May 19, 2018
Messages
50
OK so I have a formula that returns a true or false value for a certaintext string....

IF(ISNUMBER(SEARCH("EPN",B40)),"EPN","")

So if EPN is in B40 then EPN is shown in the cell where the formula is enteredotherwise it is blank. Works perfectly.

But

I now need to search a number!

IF(ISNUMBER(SEARCH("41",B40)),"41","")

Again it returns 41 or blank but

When B40 contains 412 or 4141 or any number containing 4 & 1 I still get a41 output.

How do I search for 41 only???

 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Re: Isnumber search if .......help needed!!

I'd probably just use an IF statement like so:

=IF(B40=41,41,"")

EDIT: Try this wildcard solution if you want ISNUMBER SEARCH combination:

=IF(AND(ISNUMBER(SEARCH("41",B40)),NOT(OR(ISNUMBER(SEARCH("?41",B40)),ISNUMBER(SEARCH("41?",B40))))),"41","")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top