Extract Invoice number, Mid, Right, Left, Replace, 10^10 etc.

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,860
Office Version
  1. 365
Platform
  1. Windows
I have string,
S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\Cocohills\241005-PHOO2\0817NNJ036241005-SBOO2.xlsm
And I need to extract 0817NNJ036241005-SBOO2 here it happens to be the last in this string, I would like to know how to extract this and also, if it is not the last part of the string how will I extract then.

Regards,
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
any thing unique in an invoice number that excel could search for
if there is nothing unique , like its position or a specific string or in your example it has a \ at the front and a - in the string
so maybe looking for a - and then a \ before the - may give us the unique bit
can you perhaps post a dozen different examples of the likely format
 
Upvote 0
I have string,
S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\Cocohills\241005-PHOO2\0817NNJ036241005-SBOO2.xlsm
And I need to extract 0817NNJ036241005-SBOO2 here it happens to be the last in this string, I would like to know how to extract this and also, if it is not the last part of the string how will I extract then.
Besides the questions 'etaf' asked you in Message #2 , I would like to know whether the will be a dot/extension after the Invoice Number when it is not after the last backslash character?
 
Upvote 0
All invoices have different number,
S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\cocolips\241005-PHOO2\1117NNJ036241005-SBOO2.xlsm
S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\ConocoPhillips\241005-PHOO2\0317NNJ036241005-SBOO2.xlsm
S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\ConocoPhillips\241005-PHOO2\0617NNJ036241005-SBOO2.xlsm
'S:\Houston JIB Accounting\Outside Operated JIB's\Jacquie's Group JIBs\SOHAIL RIZKI UPLOADS\ConocoPhillips\241005-PHOO2\0317NNJ036241005-SBOO2.xlk
 
Upvote 0
Hi Rick,
Thanks for your reply,
I have copied and pasted a few rows, I hope this will make myself clear.

Best regards
 
Upvote 0
If it is always the last piece (before the file extension), this should work (for an entry in cell A1):
Code:
=TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",200)),200)),".",REPT(" ",100)),100))
 
Upvote 0
Thank you Joe4

It is working as I wanted.

Thank you.
 
Last edited:
Upvote 0
you mentioned in your original post
I would like to know how to extract this and also, if it is not the last part of the string how will I extract then.
is it always the last part of string ? as in your examples
 
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