Formula to extract and concatenate

mmorris1965

New Member
Joined
Mar 14, 2016
Messages
6
Seeking a nested formula to extract specific numbers from the cells in column "A" and concatenate with data in column "B". Because some of the cells contain leading alpha characters and some do not, I am having trouble using the Mid function in my formula. I've shown the desired result in column "C".

Any assistance would be appreciated.

1609287628548.png
 
As I stated, I am very surprised at the results (I am treating the 2nd run on post 3 as a freak result btw).
Does tell me that I definitely need to use the Let function more on my own work though.
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I am very surprised at the results
I am not surprised. Not because of the LET function, but because of the REPT function. REPT(" ",100) has to concatenate 100 characters which is (relatively) time-consuming.

I agree that speed is pretty irrelevant here as I'm sure they are all fast enough & not that much different to each other, but this was about 15% faster for me that the post 5 formula.
(In the normal course of events I would most probably use a formula like Rick's though. :))

20 12 30.xlsm
ABC
2-/01/-/1-6120/RECPT10151-6120-1015
3CCH/01/-/01-6230/REC101701-6230-1017
Test speed
Cell Formulas
RangeFormula
C2:C3C2=LET(first,FIND("~",SUBSTITUTE(A2,"/","~",3))+1,MID(A2,first,FIND("/",A2,first)-first)&-B2)
 
Last edited:
Upvote 0
but this was about 15% faster for me that the post 5 formula
Came out as 12.809 milliseconds on a single run on the same data for me against the Average run of 18.1126 for post 5.
 
Upvote 0
Came out as 12.809 milliseconds on a single run on the same data for me against the Average run of 18.1126 for post 5.
(y) I'm guessing that SUBSTITUTE must be a bit slow too as avoiding that function altogether increases my speed by another approx. 15%
20 12 30.xlsm
ABC
2-/01/-/1-6120/RECPT10151-6120-1015
3CCH/01/-/01-6230/REC101701-6230-1017
Test speed
Cell Formulas
RangeFormula
C2:C3C2=LET(first,FIND("/",A2,FIND("/",A2,FIND("/",A2,FIND("/",A2)+1)+1))+1,MID(A2,first,FIND("/",A2,first)-first)&-B2)
 
Upvote 0

Forum statistics

Threads
1,214,552
Messages
6,120,172
Members
448,948
Latest member
spamiki

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