Convert Inconsistent, Paragraph-Like Data to Columns & Rows for Import

TYoung24

New Member
Joined
Jun 24, 2024
Messages
3
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Help?

We are moving records from one provider to another and their downloadable information is difficult to manipulate into a format suitable for import, and rightfully so. (Can you say Job Security?) But we ARE moving.
Please see attached image.

The data is paragraph-like with the client information above the insurance coverage data.
I am fine with using any method available in Excel that may help organize this data into proper rows and columns. I am not too well versed in Power Query, VLOOKUP, or Pivot but I will teach myself and slog my way through it if someone can point me in the right direction.

Does anyone have any guidance or suggestions?

Thanks!!!
 

Attachments

  • Inconsistent Data - Have vs Need.jpg
    Inconsistent Data - Have vs Need.jpg
    130.4 KB · Views: 13

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Cannot manipulate data in a picture. Suggest you reload your sample to this site using XL2BB or upload a sample file to either Box.net or Dropbox.com and provide a link so that we can work with real data.
 
Upvote 0
Cannot manipulate data in a picture. Suggest you reload your sample to this site using XL2BB or upload a sample file to either Box.net or Dropbox.com and provide a link so that we can work with real data.
Here you go!
 
Upvote 0
Help?

We are moving records from one provider to another and their downloadable information is difficult to manipulate into a format suitable for import, and rightfully so. (Can you say Job Security?) But we ARE moving.
Please see attached image.

The data is paragraph-like with the client information above the insurance coverage data.
I am fine with using any method available in Excel that may help organize this data into proper rows and columns. I am not too well versed in Power Query, VLOOKUP, or Pivot but I will teach myself and slog my way through it if someone can point me in the right direction.

Does anyone have any guidance or suggestions?

Thanks!!!
Dropbox with Excel file: Dropbox
 
Upvote 0
Dropbox with Excel file: Dropbox
Hi @TYoung24,

Try

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    Selected_Col = {{"Column1","Column3","Column4","Column5","Column6","Column2"}} & {{"Client", "Client ID"}},
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
    #"Filled down" = Table.FillDown(Table.AddColumn(#"Added Index", "Custom", (x)=> if x[Column1] = "Client" then x[Index] else null),{"Custom"}),
    #"Grouped rows" = Table.Group(Table.SelectRows(#"Filled down", (x)=> Text.Length(x[Column1]) = 2), {"Custom"}, {{"Custom1", each Table.SelectColumns(_, Selected_Col{0})}})[Custom1],
    Combined = Table.FromColumns(List.Combine({let x = Table.SelectRows(Source, (x)=> x[Column1] = "Client" or x[Column1] = "Client Id")[Column2] in 
    {List.Alternate(x,1,1,1)} & {List.Alternate(x,1,1)}, {#"Grouped rows"}}), Selected_Col{1} & {"Tables"}),
    #"Added Custom" = Table.AddColumn(Combined, "Custom", each List.TransformMany([Tables][Column1], (x)=> {"Policy #","Eff","Exp","Limit","Insurer"}, (x,y)=> x & " " & y)),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom1", each Table.FromRows({List.Combine(List.Transform(Table.ToRows([Tables]), each List.RemoveFirstN(_,1)))},[Custom])),
    Result = Table.ExpandTableColumn(Table.SelectColumns(#"Added Custom1", Selected_Col{1} & {"Custom1"}), "Custom1",List.Distinct(List.Union(#"Added Custom1"[Custom])))
in
    Result

Regards,
 
Upvote 0
Dropbox with Excel file: Dropbox
Power Query:
let
    // list of column names (prefix will be added later)
    columns = {" Insurer", " Policy #", " Eff", " Exp", " Limit"},
    // function transforms section into single row table
    fx = (tbl) => 
        [to_list = Table.ToList(
            Table.Skip(tbl, 3),
            (x) => [Client = tbl{0}[Column2], Client ID = tbl{1}[Column2]] & 
                Record.FromList(List.Skip(x), List.Transform(columns, (w) => x{0} & w))
        ), 
        out = Table.FromRecords({Record.Combine(to_list)})][out],
    // your source table 
    Source = Excel.CurrentWorkbook(){[Name="data_box"]}[Content],
    cln = Table.SelectRows(Source, each [Column1] <> null),
    // group by client and apply function
    group = Table.Group(cln, "Column1", {"x", fx}, GroupKind.Local, (s, c) => Number.From(c = "Client")),
    // put everything together
    result = Table.Combine(group[x])
in
    result
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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