Stock card renaming

makinmomb

Active Member
Joined
Dec 23, 2013
Messages
401
I have this

="MML "& SUBSTITUTE(MID(B1,FIND("X",B1)-3,LEN(B1)),"= ","= "&MID(B1,1,FIND(" ",B1,1)-1)&" ")

That converts

ARIEL WALL 25 X 35 = SNOW WHITE WM290A

<colgroup><col width="363"></colgroup><tbody>
</tbody>

to

MML 25 X 35 = ARIEL SNOW WHITE WM290A


I now want the above to be ( shift last word to second word after = )

MML 25 X 35 = ARIEL WM290A SNOW WHITE



<colgroup><col width="64"></colgroup><tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
doing it all in one formula can get a bit hard- I would break this down into pieces. Add a column for "last word" (do a web search for "excel formula last word"), a separate column for "first word", a separate column for "Dimensions", and one more column for "After equal sign, before last word". Then you'll have all your pieces to concatenate together.
 
Upvote 0
Mark does it work your end

What you see it post #3 is taken directly from my spreadsheet and so yes the formula in D1 works at my end (and I just copied the formula from the forum into another cell and got the same result).
 
Upvote 0
Here is another slightly shorter option...

Excel 2007
BCD
1ARIEL WALL 25 X 35 = SNOW WHITE WM290AMML 25 X 35 = ARIEL WM290A SNOW WHITE
Sheet7
Cell Formulas
RangeFormula
D1=TRIM(SUBSTITUTE(SUBSTITUTE("MML "& SUBSTITUTE(MID(B1,FIND("X",B1)-3,LEN(B1)),"= ","= "&MID(B1,1,FIND(" ",B1,1)-1)&" "),TRIM(LEFT(SUBSTITUTE(B1," ",REPT(" ",99)),99)),TRIM(LEFT(SUBSTITUTE(B1," ",REPT(" ",99)),99)&RIGHT(SUBSTITUTE(B1," ",REPT(" ",99)),99))),TRIM(RIGHT(SUBSTITUTE(B1," ",REPT(" ",99)),99)),"",2))
 
Upvote 0
I recommend you follow my advice to break it into smaller steps that are easier to understand, produce the formula yourself rather than use someone else's code that you don't know how it works.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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