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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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