# Excel formula to rearrange the cell contents ENG/DEF/001/14 to ENG/DEF/14/001

#### HelenL

##### New Member
Excel formula to rearrange the cell contents ENG/DEF/001/14 to ENG/DEF/14/001

Help appreciated - completely lost!

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### sandy666

##### Well-known Member
with PowerQuery (Get&Transform)

 raw result ENG/DEF/001/14 ENG/DEF/14/001

Code:
``````[SIZE=1]// Table1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Split = Table.SplitColumn(Source, "raw", Splitter.SplitTextByAnyDelimiter({"/"}, QuoteStyle.Csv)),
Merge = Table.CombineColumns(Split,{"raw.1", "raw.2", "raw.4", "raw.3"},Combiner.CombineTextByDelimiter("/", QuoteStyle.None),"result")
in
Merge[/SIZE]``````

Last edited:

#### ClaireS

##### Board Regular
Or just [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]=LEFT(A1,8)&MID(A1,13,2)&"/"&MID(A1,9,3) where A1 is the cell containing your source string.[/FONT]

#### kweaver

##### Well-known Member
With your original text in A1, here's an ugly formula for B1 that will make the switch:

Code:
``=LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1,"/",CHAR(1),2)))&RIGHT(A1,LEN(A1)-FIND(CHAR(1),SUBSTITUTE(A1,"/",CHAR(1),3)))&MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"/",CHAR(1),2)),FIND(CHAR(1),SUBSTITUTE(A1,"/",CHAR(1),3))-FIND(CHAR(1),SUBSTITUTE(A1,"/",CHAR(1),2)))``
This one assumes the length of the characters between the slashes might vary.

Last edited:

#### Rick Rothstein

##### MrExcel MVP
Excel formula to rearrange the cell contents ENG/DEF/001/14 to ENG/DEF/14/001
There are several ways to do this, some way more efficient than others but which might depend on the structure of your data, so I have some questions.

1) Is this for a single cell (which one) or a column of cells (which column and start row)?

2) Is the first field (the ENG) always 3 characters long?

3) Is the second field (the DEF) always 3 characters long?

4) Is the third field (the 001) always 3 digits long?

5) Is the last field (the 14) always 2 digits long (meaning single digit numbers have leading zeros in order to make it 2 digits long)?

6) Are you trying to physically change your data to this revised format directly within their cells (so if your example was in cell A1, the revised text would end up in cell A1)?

#### HelenL

##### New Member
1) single cell A1 Row 2 but will pull the formula down through the rest
2) yes
3) yes
4) yes
5)yes this is the year
6) yes

Thank you !

Last edited:

#### HelenL

##### New Member
Thank you so much that brilliant. works a treat !

#### HelenL

##### New Member
Thank you. Much appreciated

#### HelenL

##### New Member
Thank you. Much appreciated.

1,102,260
Messages
5,485,728
Members
407,510
Latest member
Tryintouseexcel

### This Week's Hot Topics

• Finding issue in If elseif else with For each Loop
Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
• MsgBox Error
Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
• CELL FORMAT - IF CONDITION
My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
• Show numbers nearly the same
Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
• Please i need your help to create formula
I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
• Got error while adding column and filter
Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...