UiPath Workflow to Group Excel Data by Age and Write to Separate Tabs

Read a excel contains three column (Name, DOB and amount) and group the excel data in to two based on th age. If the age less than 18 then write the correxponding row to a new tab (minor) in the same excel and others will be in another tab (major). Group all the rows like this

Hi @HASNA_HANEEF

Use read range to read the excel data.
Assign:

minorRecords = originalDataTable.AsEnumerable().Where(Function(row) 
    DateTime.Now.Year - Convert.ToDateTime(row("DOB")).Year < 18).CopyToDataTable()

Assign:

majorRecords = originalDataTable.AsEnumerable().Where(Function(row) 
    DateTime.Now.Year - Convert.ToDateTime(row("DOB")).Year >= 18).CopyToDataTable()

Use write range activity to write the data into excel (New sheets and delete the previous sheet)

@HASNA_HANEEF

  1. Read the data into datatable
  2. Use a filter datatable activity and give the filter as Age>18 …and write the datatable back to excel…
  3. Repeat same for the Age<18
  4. If you dont want age column in the filter datatable you can mention the Age column in the columns tab and sepect remove…it would be removed after filtering

Cheers