Search a two digit Number in a String in a Cell

ShlomiUnique

New Member
Joined
Nov 26, 2016
Messages
1
Good Day all

I have a cell with a string such as 1.2.3.4 and i want to find if this string contains a number appear in other cell, lets say cell $A$1 = 3.
I've able to do it, BUT
when i have a case with a string such as: 1.2.13.4 , it "looks" on the 3 (on $A$1) and returned as if this number is part of the string.
But i want to check if it contain 13 NOT 3.

I being thinking that maybe I should check first the Length on the A1 cell contain the number (3) and then check the cell with the string (1.2.13.4).
could not figure out how to do it....

I've Try the formula SEARCH or even by VBA , InStr(A1,"1.2.13.4"), but with no success....
1f641.png

any help will be appreciated!!!:)

VBA code will be better, as I need to Loop some other cells as well, for checking (i.e: i need to check the Criteria 3 in other cells with string as well)

Thanks A Lot !!!
Shlomi
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

AlKey

Active Member
Joined
Oct 15, 2013
Messages
395
Perhaps something like this
Where the text strings in Col A, lookup values in Col B and results in Col C
Enter formula in C1 and copy down

=ISNUMBER(SEARCH("."&B1&".","."&A1&"."))


Excel 2016 (Windows) 32 bit
ABC
11.2.13.413TRUE
21.2.13.55TRUE
31.2.23.615FALSE
41.2.16.716TRUE
Sheet3
 
Last edited:
Upvote 0

Forum statistics

Threads
1,195,720
Messages
6,011,292
Members
441,599
Latest member
Jribas

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
Top