Excel automation for getting the desired output

Hey all,

I have two excels, one is input and other output.
I’m trying to achieve the below conditions.
For every person in that Department, I want to add 1 in the output sheet for that column

I’ll attach screenshot for better understanding



Can someone help me?
It would be of great help!

Thanks in Advance!

Are you just trying to get the number of people in each department?
If the depts are fixed number, you could read excel as a DT and then use a filter ton the DT for each dept and use the row count to get the number for each Dept. You can assign this to a variable.

Hey @Matt_S,

Thanks for replying.
I’m not trying to get the count.
if the ID and Name is of a particular dept, then add 1 below that dept
I have attached the expected output.
Is there any way or suggestions for me?

Thanks again

If you simply want to create the output you are showing:
Read excelinput as DT
Add datat column for each dept.
For each row dt
row(row(2).tostring) = 1

Remove data column (the dept) in DT


set default value on add new column to 0