Along with requested pattern; Bring out 1 next following pattern

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000

Hi,

I got patterns data in cells C6:C69
In the cells E5:N5 I got patterns, which I want to extract from cells C6:C69 and put them in corresponding column E5:N5 Along with requested pattern; Bringing out 1 next following pattern

For example in column E I want to extract out pattern 1|1|1 from C6:C69 with 1 next following pattern as shown

And in column F I want to extract out pattern 1|1|X from C6:C69 with 1 next following pattern as shown

And so on for the rest.........

Example data...


Book1
ABCDEFGHIJKLMNO
1
2
3
4PattPattPattPattPattPattPattPattPattPatt
5Patt1|1|11|1|X1|1|21|X|11|2|1X|1|12|1|11|X|X1|X|21|2|X
6X|1|1X|1|1
71|1|11|1|11|1|1
81|1|X1|1|X1|1|X
91|X|X1|X|XX|1|11|X|X
101|X|11|1|11|X|11|1|11|X|1
11X|1|11|1|11|1|XX|1|1
121|1|11|1|11|X|1X|1|11|X|X
131|1|11|1|X1|X|11|1|11|2|1
141|1|11|1|XX|1|1
151|1|X1|1|11|X|XX|1|11|X|X
161|X|11|1|11|X|11|1|1X|1|1
17X|1|11|1|11|1|XX|1|1
181|1|11|1|X1|X|2X|1|1
191|1|11|1|X1|1|1
201|1|11|1|11|1|X1|X|2
211|1|X1|1|X1|X|1X|1|1
221|X|X1|X|11|1|1
231|2|11|1|11|1|X1|X|11|2|1
242|1|11|1|21|X|1X|1|12|1|1X|1|12|1|1
251|1|21|1|21|1|11|1|2
261|2|X1|1|11|1|X1|2|X1|X|11|2|11|2|X
271|X|21|1|11|X|1X|1|12|1|1X|1|12|1|11|X|21|X|2
282|1|X1|1|11|1|21|1|11|1|22|1|X
291|X|11|1|21|1|X1|2|11|X|11|2|11|2|X
30X|1|11|X|1X|1|12|1|12|1|11|X|21|X|X
311|1|11|1|11|1|21|1|11|X|1
321|1|X1|1|11|2|11|X|1
331|X|21|1|11|2|X
341|X|11|1|1
351|X|11|1|11|X|1
36X|1|11|1|X
371|1|1
381|1|21|1|1
391|2|11|1|X
402|1|1
411|1|X1|1|1
421|X|11|1|1
43X|1|11|1|1
441|1|11|1|1
451|1|11|1|X
461|1|1
471|1|2
481|2|1
492|1|1
501|1|1
511|1|1
521|1|1
531|1|1
541|1|1
551|1|X
561|X|1
57X|1|1
581|1|1
591|1|X
601|X|1
611|2|X
621|X|X
63X|1|1
641|1|1
651|1|1
661|1|1
671|1|1
681|1|X
691|X|1
70
Sheet4


Thank you in advance

Regards,
Kishan
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi, if I change layout as below, extract the pattern start in row 6 and leave the 1 space between one and another pattern. Or any another idea you got please suggest.


Book1
ABCDEFGHIJKLMNO
1
2
3
4PattPattPattPattPattPattPattPattPattPattPatt
5Patt1|1|11|1|X1|1|21|X|11|2|1X|1|12|1|11|X|X1|X|21|2|X
6X|1|11|1|11|1|X1|1|21|X|11|2|1X|1|12|1|11|X|X1|X|21|2|X
71|1|11|1|X1|X|X1|2|XX|1|12|1|11|1|11|1|21|X|12|1|X1|X|2
81|1|X
91|X|X1|1|11|1|X1|1|21|X|11|2|1X|1|12|1|11|X|X1|X|21|2|X
101|X|11|1|11|X|11|2|1X|1|12|1|11|1|11|1|21|2|11|X|11|X|X
11X|1|11|1|1
121|1|11|1|X1|1|X1|1|21|X|11|2|1X|1|12|1|11|X|X
131|1|11|X|X1|2|1X|1|12|1|11|1|11|1|1X|1|1
141|1|11|1|1
151|1|X1|1|11|1|X1|1|XX|1|1
161|X|11|1|11|X|21|X|21|1|1
17X|1|11|1|X
181|1|11|1|X1|X|1X|1|1
191|1|11|1|11|X|11|X|11|1|1
201|1|11|1|XX|1|1
211|1|X1|1|XX|1|1
221|X|X1|1|11|X|11|X|11|1|1
231|2|11|1|2X|1|1
242|1|11|1|XX|1|1
251|1|21|1|11|X|11|X|11|1|1
261|2|X1|1|1X|1|1
271|X|21|1|11|1|XX|1|1
282|1|X1|1|21|X|11|X|11|1|1
291|X|11|2|X
30X|1|11|1|1
311|1|11|1|11|X|1
321|1|X1|1|1
331|X|21|1|1
341|X|11|1|1
351|X|11|1|X
36X|1|1
371|1|11|1|1
381|1|21|1|X
391|2|1
402|1|11|1|1
411|1|X1|1|1
421|X|11|1|1
43X|1|11|1|1
441|1|1
451|1|11|1|X
461|1|1
471|1|2
481|2|1
492|1|1
501|1|1
511|1|1
521|1|1
531|1|1
541|1|1
551|1|X
561|X|1
57X|1|1
581|1|1
591|1|X
601|X|1
611|2|X
621|X|X
63X|1|1
641|1|1
651|1|1
661|1|1
671|1|1
681|1|X
691|X|1
70
Sheet5


Thank you in advance

Regards,
Kishan
 
Last edited:
Upvote 0
Hi, or may I get solution for only 1 pattern 1|1|1? As shown below


Book1
ABCDEF
1
2
3
4PattPatt
5Patt1|1|1
6X|1|11|1|1
71|1|11|1|X
81|1|X
91|X|X1|1|1
101|X|11|1|1
11X|1|11|1|1
121|1|11|1|X
131|1|1
141|1|11|1|1
151|1|X1|1|1
161|X|11|1|1
17X|1|11|1|X
181|1|1
191|1|11|1|1
201|1|11|1|X
211|1|X
221|X|X1|1|1
231|2|11|1|2
242|1|1
251|1|21|1|1
261|2|X1|1|1
271|X|21|1|1
282|1|X1|1|2
291|X|1
30X|1|11|1|1
311|1|11|1|1
321|1|X1|1|1
331|X|21|1|1
341|X|11|1|1
351|X|11|1|X
36X|1|1
371|1|11|1|1
381|1|21|1|X
391|2|1
402|1|11|1|1
411|1|X1|1|1
421|X|11|1|1
43X|1|11|1|1
441|1|1
451|1|11|1|X
461|1|1
471|1|2
481|2|1
492|1|1
501|1|1
511|1|1
521|1|1
531|1|1
541|1|1
551|1|X
561|X|1
57X|1|1
581|1|1
591|1|X
601|X|1
611|2|X
621|X|X
63X|1|1
641|1|1
651|1|1
661|1|1
671|1|1
681|1|X
691|X|1
70
Sheet5


Thank you in advance

Regards,
Kishan
 
Last edited:
Upvote 0
Why does E6 have a match in your last example? (i think some of your data results may be incorrect, based on your question...)

Also, do the colors matter? (ie. is this a formula or a VBA question)
 
Upvote 0
Why does E6 have a match in your last example? (i think some of your data results may be incorrect, based on your question...)

Also, do the colors matter? (ie. is this a formula or a VBA question)
Hi, dave2018 in the E5 I have pattern 1|1|1, which I want to extract from column C, so first patt find in the cell C7 and next to it E8, which is shown in the cells E6:E7, second find in cells C12, 13, 14 and next to it E15, which is shown in cells E9:E12.... an so on

Colour is no matter it is filled and shown to explain example clearly

Thank you in advance

Regards,
Kishan
 
Last edited:
Upvote 0
I'm sorry. i still dont understand how the numbers are supposed to appear in their respective cells based on the criteria in the header rows...
 
Upvote 0
I'm sorry. i still dont understand how the numbers are supposed to appear in their respective cells based on the criteria in the header rows...
Hi, dave2018

In the cells C6:C69 I got the data, and in the cell E5 I have the patter "1|1|1", which I want to look in column C
Bring out all "1|1|1" from C6:C69 along with 1 next following pattern

First pattern "1|1|1" found in column C, in the cell C7, so copy "C7 and next C8" and paste into the cells E6:E7

Second pattern "1|1|1" found in the column C, in the cells C12, 13, 14, so copy "C12, C13, C14 and next C15" and paste into the cells E9:E12

Third pattern "1|1|1" found in the column C, in the cells C18, 19, 20, so copy "C18, C19, C20 and next C21" and paste into the cells E14:E17

May this help

Formula will work; I prefer the VBA solution if possible

Thank you in advance

Regards,
Kishan
 
Last edited:
Upvote 0
oh i get it, the values in E do not correspond by ROW to the values in C...

Getting right to work on it... :)
 
Upvote 0
oh i get it, the values in E do not correspond by ROW to the values in C...

Getting right to work on it... :)
Hi, dave2018 it is correct you got it

Thank you in advance

Regards,
Kishan
 
Upvote 0
Hi, any suggestions

Question in post_3 and explained in post_7

Regards,
Kishan
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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