How to copy specific rows from a excel to new excel based on condition

Hi Everyone,
I have a Excel (employees attendance sheet) generated from a database. My requirement is to make a new excel with Employee code, Employee name and status. The status has two values “Present and Absent” . Here i need employees with only absent status in my new excel. Here in the excel I have report of 1 month. so after every date there is break in the sheet. refer below image.

I tried to implement it but unable to write them to a new excel. Kindly help in providing the solution. For reference i’m attaching the excel here. Your help is much appreciated.
Daily_Attendance_Report_Feb2019.xls (33.5 KB)

Thank you all.

1 Like


You can do something like this:

  1. Use Read Range to save the whole excel to a Data table
  2. Use For each row to iterate each row
  3. Use Read Cell to get the value of the status column
  4. Use If Activity, If Status is Equal to “Absent”, use Read range to get the Name and Code.
  5. Generate Data Table using the Name, Code and Status that you extract.
  6. Use Append Range.
  7. Make sure you have counter variable so you can get the value of Status for each row.

I also attached the xaml file that I created for your reference.
Sequence.xaml (21.4 KB)

@sridhar1516 There are two methods for this check both these Files
Using Filter (12.5 KB) (13.0 KB)

Thank you @albert.yango.

Thank you @vickydas. will run the xaml and get back to you .

Dear @vickydas/@albert.yango in the excel there is a column Work Dur. I want employees whose work Dur is less than 8. Your help is much appreciated.

Thank you

Hello @sridhar1516

get that row using get row activity and put it inside an IF block with that condition

hi @vickydas can you please share the condition of work Dur is less than 8

hello @sridhar1516 you have to set the condition according to your requirment

in your case
(inside if block)
workdur (the variable we get using get row) < 8

@vickydas hi… yeah implemented and got the output

Hey @sridhar1516


I hope you learned from the examples above and can solve problems like this on your own in the near future :slight_smile: