Split and group values in excel

nagasree

New Member
Joined
Oct 30, 2021
Messages
30
Office Version
  1. 2019
Platform
  1. Windows
Hi I have a column of values which has different suffix after a dot, i need it to group it based on the value after dot. Example i need to split all values that end with .pdf into one column, values with.xls as another column, etc,,,
1674309301341.png

how to do this is my doubt.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

With your data located in range A1:A10, you could test following Array Formula in cell D1:
VBA Code:
=IFERROR(INDEX($A$1:$A$10,SMALL(IF(RIGHT($A$1:$A$10,3)="pdf",MATCH(ROW($A$1:$A$10),ROW($A$1:$A$10)),""),ROWS(C1:$C$1))),"")

Hope this will help
 
Upvote 0
THere is probably a much cleaner way, but this is two formulas.

WorkBook1.xlsx
ABCDE
1
2documentpdfdwsxls
3abc.pdfabc.pdfadc.dwsdef.xls
4adc.dwsdef.pdfghi.dws
5def.pdfghi.pdf
6def.xls
7ghi.pdf
8ghi.dws
Sheet3
Cell Formulas
RangeFormula
C2:E2C2=TRANSPOSE(UNIQUE(SUBSTITUTE($A$3:$A$8,LEFT($A$3:$A$8,FIND(".",$A$3:$A$8)),"")))
C3:C5,E3,D3:D4C3=FILTER($A$3:$A$8,ISNUMBER(FIND(C$2,$A$3:$A$8)))
Dynamic array formulas.
 
Upvote 0
@awoohaw The OP's profile shows they are using 2019 & so do not have those functions.
 
Upvote 0
@nagasree

Have you tested the formula posted in message #2 in cell C1 ? ... then copy down and right ... and adjust for extensions ...
 
Upvote 0
an alternative is power query
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "document", Splitter.SplitTextByDelimiter(".", QuoteStyle.Csv), {"document.1", "document.2"}),
    #"Duplicated Column" = Table.AddColumn(#"Split Column by Delimiter", "document.2 - Copy", each [document.2], type text),
    #"Inserted Merged Column" = Table.AddColumn(#"Duplicated Column", "Merged", each Text.Combine({[document.1], [document.2]}, "."), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Inserted Merged Column",{"document.2"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"document.2 - Copy"]), "document.2 - Copy", "Merged"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"document.1"})
in
    #"Removed Columns1"
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,974
Members
449,095
Latest member
Mr Hughes

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