Finding exact number in a string

randomX

New Member
Joined
Aug 2, 2010
Messages
10
Hello,

I have the following problem:

in column A I have series of numbers separated by commas (1,4,7, etc.). The numbers range from 1 to 27. I need to find in a separate column if, for instance, the cell A2 contains the number "1". I tried various formulas like find, search, etc. the problem is that the results is "true" even if, for instance the string in the cell is "2,7,14". I mean I need to find only occurrences of the exact number in the string. Hope it is clear.

Thank you.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I think you need to count the number of occurences of "1," and subtract the number of occurences of "11," & "21,"
 
Upvote 0
Excel Workbook
AB
11
21,4,7,11,12,13,20,21TRUE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
B2=ISNUMBER(SEARCH(","&B1&",",","&A2&","))


(Where cell B1 contains the number you wish to test for)
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,947
Members
449,095
Latest member
nmaske

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