Looking for formula to search for particular pattern in Excel
up vote
-2
down vote
favorite
I am looking for formula to search for "words" with a particular letter pattern, like INNSA1 or INMAA4 or INPTPB, where the word starts with IN and ends with 4, 1, 6, or B.
A collection of Excel cells each contain a sentence in which one such word may be found. For example:
- My Custom location is INNSA1
- I work at INMAA4
- I want to go to INDEL6
The word may be in a position other than the last word of the sentence.
For each sentence (i.e., cell), I want to search for the presence of any word fitting the described letter pattern, and return this word as value.
microsoft-excel worksheet-function microsoft-excel-2010 microsoft-excel-2013
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 4 more comments
up vote
-2
down vote
favorite
I am looking for formula to search for "words" with a particular letter pattern, like INNSA1 or INMAA4 or INPTPB, where the word starts with IN and ends with 4, 1, 6, or B.
A collection of Excel cells each contain a sentence in which one such word may be found. For example:
- My Custom location is INNSA1
- I work at INMAA4
- I want to go to INDEL6
The word may be in a position other than the last word of the sentence.
For each sentence (i.e., cell), I want to search for the presence of any word fitting the described letter pattern, and return this word as value.
microsoft-excel worksheet-function microsoft-excel-2010 microsoft-excel-2013
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts withIN, and ends with4, 1, 6, orb), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)
– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday
|
show 4 more comments
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
I am looking for formula to search for "words" with a particular letter pattern, like INNSA1 or INMAA4 or INPTPB, where the word starts with IN and ends with 4, 1, 6, or B.
A collection of Excel cells each contain a sentence in which one such word may be found. For example:
- My Custom location is INNSA1
- I work at INMAA4
- I want to go to INDEL6
The word may be in a position other than the last word of the sentence.
For each sentence (i.e., cell), I want to search for the presence of any word fitting the described letter pattern, and return this word as value.
microsoft-excel worksheet-function microsoft-excel-2010 microsoft-excel-2013
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am looking for formula to search for "words" with a particular letter pattern, like INNSA1 or INMAA4 or INPTPB, where the word starts with IN and ends with 4, 1, 6, or B.
A collection of Excel cells each contain a sentence in which one such word may be found. For example:
- My Custom location is INNSA1
- I work at INMAA4
- I want to go to INDEL6
The word may be in a position other than the last word of the sentence.
For each sentence (i.e., cell), I want to search for the presence of any word fitting the described letter pattern, and return this word as value.
microsoft-excel worksheet-function microsoft-excel-2010 microsoft-excel-2013
microsoft-excel worksheet-function microsoft-excel-2010 microsoft-excel-2013
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 21 hours ago
fixer1234
17.3k144280
17.3k144280
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
ajit maurya
62
62
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
ajit maurya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts withIN, and ends with4, 1, 6, orb), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)
– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday
|
show 4 more comments
2
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts withIN, and ends with4, 1, 6, orb), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)
– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday
2
2
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts with
IN, and ends with 4, 1, 6, or b), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)– fixer1234
yesterday
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts with
IN, and ends with 4, 1, 6, or b), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday
|
show 4 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
This is just an example that you can adapt to your schema.
With data from A2 to A26, in B2 enter:
=IF(AND(LEFT(A2,2)="IN",OR(RIGHT(A2,1)="B",RIGHT(A2,1)="1",RIGHT(A2,1)="4",RIGHT(A2,1)="6")),1+MAX($B$1:B1),"")
and copy downward:

As you see, each item of "good" data is marked with a simple sequential index.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This is just an example that you can adapt to your schema.
With data from A2 to A26, in B2 enter:
=IF(AND(LEFT(A2,2)="IN",OR(RIGHT(A2,1)="B",RIGHT(A2,1)="1",RIGHT(A2,1)="4",RIGHT(A2,1)="6")),1+MAX($B$1:B1),"")
and copy downward:

As you see, each item of "good" data is marked with a simple sequential index.
add a comment |
up vote
0
down vote
This is just an example that you can adapt to your schema.
With data from A2 to A26, in B2 enter:
=IF(AND(LEFT(A2,2)="IN",OR(RIGHT(A2,1)="B",RIGHT(A2,1)="1",RIGHT(A2,1)="4",RIGHT(A2,1)="6")),1+MAX($B$1:B1),"")
and copy downward:

As you see, each item of "good" data is marked with a simple sequential index.
add a comment |
up vote
0
down vote
up vote
0
down vote
This is just an example that you can adapt to your schema.
With data from A2 to A26, in B2 enter:
=IF(AND(LEFT(A2,2)="IN",OR(RIGHT(A2,1)="B",RIGHT(A2,1)="1",RIGHT(A2,1)="4",RIGHT(A2,1)="6")),1+MAX($B$1:B1),"")
and copy downward:

As you see, each item of "good" data is marked with a simple sequential index.
This is just an example that you can adapt to your schema.
With data from A2 to A26, in B2 enter:
=IF(AND(LEFT(A2,2)="IN",OR(RIGHT(A2,1)="B",RIGHT(A2,1)="1",RIGHT(A2,1)="4",RIGHT(A2,1)="6")),1+MAX($B$1:B1),"")
and copy downward:

As you see, each item of "good" data is marked with a simple sequential index.
edited 2 days ago
answered 2 days ago
Gary's Student
13.2k31729
13.2k31729
add a comment |
add a comment |
ajit maurya is a new contributor. Be nice, and check out our Code of Conduct.
ajit maurya is a new contributor. Be nice, and check out our Code of Conduct.
ajit maurya is a new contributor. Be nice, and check out our Code of Conduct.
ajit maurya is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376187%2flooking-for-formula-to-search-for-particular-pattern-in-excel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Heavy vote-down for shouting in all-capitals. Strongly suggest you edit.
– Michael Harvey
2 days ago
I don't really have a clear picture of your requirement. Are you looking for the presence (true/false) of a "word" (i.e., character string containing only alphanumerics--letters/numbers but no spaces or other kinds of characters), matching a pattern (starts with
IN, and ends with4, 1, 6, orb), which can be located anywhere in a "sentence" but delimited from it by space or punctuation, that is contained in a single cell? Is it always a separate "word" or can it be a character string embedded in a longer "word"? (cont'd)– fixer1234
yesterday
Is it always exactly 6 characters? Are the letters always uppercase? What do the "sentences" look like? Can the "word" appear more than once, including as part of a larger word? This would be easier to understand if you include examples of the sentences that represent the range of conditions.
– fixer1234
yesterday
Also, as Gary's Student interpreted, is the word the only thing in the cell or is it somewhere within other text in a cell (which are very different requirements)?
– fixer1234
yesterday
I want to search particular pattern in a sentence in a cell. e.g. " My Custom location is INNSA1" OR "I work at INMAA4" or "I want to go to INDEL6"
– ajit maurya
yesterday