Hi Nithin, I used calculated fields. You can use regular expressions to do the same too
1. Create a calculative field to classify students from different departments.

2. Create another calculative field to classify students into sections.

3. The groups are as follow.


4. Now add both the fields into filter shelf to perform filters.
Hope this helps you.