sqlexceldatabaseexcel-formula

Getting the data of one column from another column in Excel


I am having the following data in Excel containing thousands of students records with their GPAs.

As you can see in the image, there are multiple records for the same student, each of witch having his/her GPA in a single semester.

I want to calculate the final GPA of all of students, the final GPA is the GPA the student got in his/her final semester. So how can I collect and take the highest (semester) value of one student and to take its corresponding GPA value?

Is it possible to do this in Excel and how? and if anyone can lead me how to do it in Python or SQL?

Thanks The image of the dataset

Update I figured it out by using the (Group by) feature, that is working in the (Power Query Editor) in Excel.


Solution

  • I understood your aim to be find all records for a given student ID, and then find the maximum value of the GPAs.

    I would recommend doing this using a pivot table.

    1. Highlight cells containing your data
    2. Go to Insert > Pivot Tables; Click OK on the pop up dialog
    3. In the right hand panel that shows up, select Student Number & GPA to be shown.
    4. Ensure Student Number is in the Rows box. If it is not, drag it to the Rows box.
    5. Ensure GPA is in the Values box. Right click > Field settings. A pop up with "Summarize By" should show up. In the list, select Max.

    Let me know if this helps! Can add screenshots if needed.