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

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,508
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>
dataexpected result
4.01.01.01.001.0104010101001-010
4.01.01.05.001.0074010105001-007
4.01.01.05.001.3424010105001-342

<tbody>
</tbody>


any help, thanks advance

.sst
 
Last edited:

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,588
Office Version
365, 2019, 2016
Platform
Windows
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:

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,588
Office Version
365, 2019, 2016
Platform
Windows
This formula too.
Code:
=SUBSTITUTE(REPLACE(A2,LEN(A2)-3,1,"-"),".","")
 
Last edited:

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,588
Office Version
365, 2019, 2016
Platform
Windows
I just saw that. I updated the formulas in the previous posts. They should be correct now.
 

Forum statistics

Threads
1,081,420
Messages
5,358,574
Members
400,504
Latest member
RedSquirrel

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top