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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

ztodd

Board Regular
Joined
Sep 17, 2014
Messages
221
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

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
15,024
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
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

Snakehips

Well-known Member
Joined
May 17, 2009
Messages
5,700
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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

ztodd

Board Regular
Joined
Sep 17, 2014
Messages
221
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,191,047
Messages
5,984,350
Members
439,882
Latest member
gerdc

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
Top