Excel Automation - How to assign a rank based on marks

Hello UiPath Community,

I have given sheet and I want to assign a rank to student based on their marks in N column.If any student is fail in any exam rank should be NA.

How can I achieve this in uipath?

Thanks in Advance.

Hi @shubham_dubey

In what bases we know the student is fail?

In the column m (At_Kt) is represent the no of fail count.

Have a look on the XAML file

NAFailColumn.xaml (11.3 KB)



please follow these steps
1-read sheet with Read Range Activity
2-In read range activity give path of file, sheet name and datatable.
3-use for each Datatable row on Datatable.
4-put if condition
5- Condition will be " row.Item(“At_Kt”).ToString >=1
6-In then block put Assign Activity
7- In Assign Activity left side → Put row.item(“Rank”)
8-In Assign Activity right side → put “NA”
9-After loop put write range and give sheet name, path of output file and datatable

1 Like

Hello Gokul,

In any subject if student has less than 40, it should be marked as interger(In how many subject student is failed) in AT_Kt column.


You can sort on At_Kt in ascending and Total in descending order. Then loop over each row, If At_Kt = 0 assign rank starting at 1 else rank is ‘NA’

Hi @shubham_dubey

Then Check out the XAML file it will return the output

Let us know it helps you