Comparing sheets

Hi,
I have excel sheet with 5 sheet i want count of one of my column by comparing with all 5 sheets

Status ->sheet1 Status ->sheet2 Status->sheet3 Status->sheet4 Status->sheet5
123 123 456 344 123
456 234 234 234 456
789 789 123 123 789

output
123 ->count=5
456->count=3
789->count=3
234->count=3
344->count=1


Thanks in advance

1 Like

100517.xaml (15.3 KB)

3 Likes

Hi Vaidya,

I needed one more thing to be added to my previous question

Use same code

  1. Add Total column to datatable.

  2. Use this as output Variable

dtSheets.AsEnumerable().GroupBy(Function(r) r.Field(Of Double)("status")).Select(Function(g) New With {Key.Status = g.Key.ToString,Key.Count = "Count =>"+ g.Count().ToString+","+g.Sum(Function(x) x.Field(Of Double)("total")).ToString}).ToDictionary(Function(a) a.Status, Function(a) a.Count)

  1. You need to split your Dictionary item.Value by comma to get Sum and Total Values and pass into Item Array of Add Data Row.
1 Like