Dataset question - listing multiple lines of data with the same ID by group

kboedeker

New Member
Joined
Oct 24, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a dataset with >1000 lines of data. Column A is a 10-digit ID that I need to deidentify to a non-identifying code. An example is below.
What formula should I use to create column B and list all of the groups of numbers as one site?

Thanks in advance!


Column A (currently lists sample data as 10 digit ID number - this is not the actual data)Column B - this is the new column that I want to create and list these as (01, 02, 03, 04... etc.)Columns c-f (unique data like location, values, scores, etc.)
974658410201
974658410201
974658410201
974658410201
762518263702
762518263702
762518263702
762518263702
762518263702
112223731303
112223731303
112223731303
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Here is a power query solution that replicates your results without the preceding 0

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"ID"}, {{"Data", each _, type table [ID=number]}}),
    #"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 1, 1, Int64.Type),
    #"Expanded Data" = Table.ExpandTableColumn(#"Added Index", "Data", {"ID"}, {"ID.1"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Data",{"ID.1"})
in
    #"Removed Columns"

Book14
CD
297465841021
397465841021
497465841021
597465841021
676251826372
776251826372
876251826372
976251826372
1076251826372
1111222373133
1211222373133
1311222373133
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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