Formula extract help

John44

Board Regular
Joined
Oct 1, 2014
Messages
60
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a whole list of entries like this. I need to pull out the job reference i.e. the J code. As the J code can vary from 5 to 7 characters then I can't use the FIND and MID to pull out the entire ref sometimes. Also, it pulls out descriptions for non job entries like ' - June' which I don't need. I need it to start at the J, determine it's a value after the J and then return up to the space before the dash after the J code. Does that make sense?

Can anyone help?

Thanks

John



1737036239962.png
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Will the format always be the same, meaning your data is always after the second - ? ( whatever the length)
 
Upvote 0
Not sure. But the J string is always preceded and finished with the spaces and dashes.
 
Upvote 0
Post 5-10 entries in a copy-able format (not picture). One sample is not representative enough.
Which version of Excel are you using?
 
Upvote 0
Job CodeDescription
=IF((ISERROR(MID(G2,(FIND(" - J",G2))+3,4))),"",(MID(G2,(FIND(" - J",G2))+3,4)))GoDaddy - July Bill
J000Fuel card - Part 2/5, FUEL CARD inv. 9003230422, date: 15/05/2022 - J000063 - Marine View, Fleetwood
J129PayByPhone Parking - Premier House; 07/03/2024; 6490 - J129
J132KaydeeSayfa - PO5598, Church Road, Crosby, 1st retention - J132
 
Upvote 0
How's that? I've shown the formula in the top one. No clue on version but I presume up to data as MS office 365 subscription is up to date
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,225,613
Messages
6,186,003
Members
453,334
Latest member
Prakash Jha

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