I hope everyone doing well.
I stuck in a scenario that I want to calculate the Rank of the students from the list of marks list which is in excel.
Like
Total_Marks | Rank
459 2
296
260
435
342
262
494 1
380
340
323
From above marks I need to calculate the rank of the each student.
Which student scored more marks he should assign with 1st rank,then 2nd rank and so on.
From above example the guy who scored 494 will need to assign 1st rank and for a guy who scored 459 should get the rank 2nd and so on the guy who scored least marks should get last rank…
I think you can use Sort datatable.
Specify the column you want to sort in, and then use the descending sort. If there is no column to index, why don’t you add one?
Hi @HeartCatcher Sort Rank.zip (7.3 KB)
please find the sample code for the above query , i have done in a simple way (Non Linq)
just run the file and try to understand how it works ,attached input file too