Get maximum value based on unique values

后端 未结 3 2017
名媛妹妹
名媛妹妹 2021-01-24 05:20

I have two columns in Excel as follows:

col1  col2

1     10
1     22
1     11
1     23
1     14
2     16
2     12
2     10
2     9

How do I wr

3条回答
  •  再見小時候
    2021-01-24 06:01

    Pivot tables: the single most underutilized and powerful feature of excel.

    • File menu:
    • Insert
    • Pivot Table
    • Select range
    • Fill in as indicated in image below

    enter image description here

    Step by Step:

    • Place cursor in cell to right of all data on sheet.
    • Select insert from menu
    • select pivot table icon
    • select pivot table from pop-up of icon
    • use the button to select the range of cells included (all 600+ rows in 2 columns) (or just enter $A:$B)
    • select ok
    • A pivot table field list appears on the right:
    • Drag and drop row 1 into row labels.
    • drag and drop row 2 into values area.
    • left click on "... of Row 2"
    • select value field settings
    • select "Max" instead of count or sum
    • select ok and you should have desired results.

    The pivot table will find the max value in row 2 for each unique value in row 1 which is what I believe you are after.

提交回复
热议问题