Delete (.) Then Combine 3 Last Number With Mark (-)

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all...

how to modify data like this

<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
[TABLE="class: tableizer-table"]
<tbody>[TR="class: tableizer-firstrow"]
[TH]data[/TH]
[TH]expected result[/TH]
[/TR]
[TR]
[TD]4.01.01.01.001.010[/TD]
[TD]4010101001-010
[/TD]
[/TR]
[TR]
[TD]4.01.01.05.001.007[/TD]
[TD]4010105001-007
[/TD]
[/TR]
[TR]
[TD]4.01.01.05.001.342[/TD]
[TD]4010105001-342[/TD]
[/TR]
</tbody>[/TABLE]


any help, thanks advance

.sst
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
A formula.
Code:
=SUBSTITUTE(LEFT(A2,LEN(A2)-4),".","")&"-"&RIGHT(A2,3)

Or PowerQuery...

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Split = Table.SplitColumn(Source, "Data", Splitter.SplitTextByEachDelimiter({"."}, QuoteStyle.Csv, true), {"Data.1", "Data.2"}),
    Replace = Table.ReplaceValue(Split,".","",Replacer.ReplaceText,{"Data.1"}),
    Merge = Table.AddColumn(Replace, "Merged", each Text.Combine({[Data.1], Text.From([Data.2], "en-US")}, "-"), type text),
    Remove = Table.RemoveColumns(Merge,{"Data.1", "Data.2"})
in
    Remove
 
Last edited:
Upvote 0
This formula too.
Code:
=SUBSTITUTE(REPLACE(A2,LEN(A2)-3,1,"-"),".","")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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