Excel automation How to perform calculations

I want to calculate No of days present,Absent days,Holidays,Attendence,Percentage on Data sheet on the basis of the data available on attendance sheet .how we should perform operation on datatable after reading the data from data sheet .navneet.xlsx (9.4 KB)

1 Like

Hi @Navneetj3
At first glance in your excel you can compute all the No of days present,Absent days,Holidays,Attendence,Percentage using the excel formula.

Do you really want it to compute in the UIPATH ?

cheers :smiley:

Happy learning :smiley:

1 Like

yes pattyricarte , i want to create a workflow that will create a sheet and fill the data based on attendance sheet .

1 Like

Hope these steps would help you resolve this
—use a excel application scope and pass the file path as input
—inside the scope use a Read range activity and get the output with a variable of datatable named d—now use a for each row loop and mention the variable dt as input
—inside the loop use a while loop and mention the condition like this colindex < dt.columns.count
Where colindex is a variable of type int32 with default value as 1 defined in the variable panel
—now inside the while loop use a assign activity like this
int_present = IF(row(colindex).ToString,Equals(“P”),presentcount+1,presentcount)

where presentcount is variable of type int32 with default value as 0 defined in the variable panel

The use another assign activity like this
int_Absent = IF(row(colindex).ToString,Equals(“A”),absentcount+1,absentcount)

where absentcount is variable of type int32 with default value as 0 defined in the variable panel

And finally one more assign activity like this

int_holiday = IF(row(colindex).ToString,Equals(“H”),holidaycount+1, holidaycount)

where holidaycount is variable of type int32 with default value as 0 defined in the variable panel

Next to this while loop use a WRITE CELL activity and mention the input as int_present and mention the cell as “C”+dt.Row.IndexOf(row)+2
Similarly use n number of write cell activity and mention the input and cell range like this with the index of expression

Hope this would help you
Cheers @Navneetj3

3 Likes

thanks palani! i will follow and try with the provided solutions :slight_smile:

1 Like

Cheers
@Navneetj3

hi Palaniyappan,

i’m getting this error can you help me how to fix it.

Compiler error(s) encountered processing expression “IF(row(colindex).ToString,Equals(“P”),presentcount+1,presentcount)”.
Option Strict On disallows implicit conversions from ‘String’ to ‘Boolean’.
‘Equals’ is not declared. It may be inaccessible due to its protection level.

hi palani,
can we manage multiple processes through ui path robot???

Hi
Welcome to uipath community
Yah of course
Can I have an example of your scenario
@Khaza_Hussain

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.