Selecting the max with a condition in excel

后端 未结 2 1444
眼角桃花
眼角桃花 2020-12-20 06:51

I have a range in excel with dates and values

http://lh4.ggpht.com/_i-hI_3gfy08/SoSIopeZUZI/AAAAAAAABEk/KjFnq57VTUc/table.png EDIT:image added

I want to sele

2条回答
  •  萌比男神i
    2020-12-20 07:34

    There are three options available.

    My preferred option is to create a pivot table without a helper column.

    • Option 1: Use a pivot table

    Create a pivot table of your data.

    Set the row to the date field and group it by year. Alternately a 'Year' helper column could be used by adding a column with this formula.

    =YEAR(A2)
    

    Set the data items value portion of the pivot table to be the MAX of your 'High' field

    • Option 2: Use the DMAX function

    Add a helper column titled year with the formula

    =YEAR(A2)
    

    Then add a formula for each year

    =DMAX(A1:C21,"High",F13:F14)
    
    • Option 3: Use an array formula

    Enter an array formula for each year using the Ctrl-Shift-Enter keys.

    {=MAX(IF(YEAR(A2:A21)=2008,B2:B21))}
    

提交回复
热议问题