Nested mid search

fueledbycheerios

New Member
Joined
Nov 17, 2011
Messages
6
Hello

I have a string of text of variable length which contains an 8 digit purchase order number which I need to find. However, the format for the PO varies between “PO #”, “PO#” etc.

I am able to return the PO number using the following example formulas

=IFERROR(MID(AI5,SEARCH("PO#",AI5)+4,8),"")
=IFERROR(MID(AI5,SEARCH("PO #",AI5)+5,8),"")
=IFERROR(MID(AI5,SEARCH("PO -",AI5)+5,8),"")

What I am unable to do is make these in to a signal formula, any suggestions?

Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Always provide example input for this class of problems...

That said, does this work for you?

=IFERROR(LEFT(TRIM(REPLACE(SUBSTITUTE(A15," ",""),1,4,"")),8),"")
 
Upvote 0
Assuming there is only one PO number in each string then this should work.
Code:
=IFERROR(MID(AI5,SEARCH("PO#",AI5)+4,8),"")&IFERROR(MID(AI5,SEARCH("PO #",AI5)+5,8),"")&IFERROR(MID(AI5,SEARCH("PO -",AI5)+5,8),"")
 
Upvote 0
Assuming there is only one PO number in each string then this should work.
Code:
=IFERROR(MID(AI5,SEARCH("PO#",AI5)+4,8),"")&IFERROR(MID(AI5,SEARCH("PO #",AI5)+5,8),"")&IFERROR(MID(AI5,SEARCH("PO -",AI5)+5,8),"")



That's worked like a charm, thanks for the help!
 
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