Search for, then extract specific text from a string and separate into columns.

jayhouse

New Member
Joined
Jan 2, 2017
Messages
13
Hello, I am trying to figure out a method to extract upto 10 numbers from within a varied string length and print them out to the proceeding columns.
There will always be atleast one "Fail" in the line and i need the policy id Preceding. Then search for the next fail and print it out in the next column until there are no more.

The Policy number length can range between 6 and 11 characters, but will always be between quotations.

Here is an example of what i am working with.

[TABLE="class: grid, width: 1000, align: left"]
<tbody>[TR]
[TD]Input[/TD]
[TD]Fail 1[/TD]
[TD]Fail 2[/TD]
[TD]Fail 3[/TD]
[TD]Fail 4[/TD]
[TD]Fail 5[/TD]
[TD]Fail 6[/TD]
[TD]Fail 7[/TD]
[TD]Fail 8[/TD]
[TD]Fail 9[/TD]
[TD]Fail 10[/TD]
[/TR]
[TR]
[TD][{"PolicyId":"31.13.1","Result":"Skip"}],[{"PolicyId":"21.2.1","Result":"Fail","Notes":"blah blah blah blah.
","AdditionalItems":[]}][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][{"PolicyId":"31.32.11","Result":"Fail","Notes":"blah blah blah blah blah blah blah.
","AdditionalItems":[]}],[{"PolicyId":"6000.12.13","Result":"Fail","Notes":"blah blah blah blah.
","AdditionalItems":[]}][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Give this a try, the formula in cell B2 should be copied across and down as needed:
Excel Workbook
ABC
1InputFail 1Fail 2
2[{"PolicyId":"31.13.1","Result":"Skip"}],[{"PolicyId":"21.2.1","Result":"Fail","Notes":"blah blah blah blah.","AdditionalItems":[]}]21.2.1*
3[{"PolicyId":"31.32.11","Result":"Fail","Notes":"blah blah blah blah blah blah blah. ","AdditionalItems":[]}],[{"PolicyId":"6000.12.13","Result":"Fail","Notes":"blah blah blah blah.","AdditionalItems31.32.116000.12.13
Sheet
 
Upvote 0
:eeek: How the.. Yeah this works!
I am a little confused how its working, but i guess i will need to watch the formula work and study up! Thank you for the hel
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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