Find Max Value in Column if meets criteria and return corresponding cell value?

浪子不回头ぞ 提交于 2021-01-29 03:14:19

问题


I have a spreadsheet with times and tasks like so:

   Company: PG Limited

    Task    Time
    A       1
    B       7
    C       9 
    A       10


    Company: BP Limited

    Task    Time
    A       7
    B       3
    C       1 
    A       1

I want to find the max value in my Time column where the task is "A" and return the company name.

Can this be done? I would really appreciate help with this. Here's my max formula:

=MAX(IF('Total Data'!D:D="A",'Total Data'!E:E))

Here's the adapted formula where i have tried using index match

=INDEX('Total Data'!E:E,MATCH(MAX(IF('Total Data'!D:D="Total",'Total Data'!E:E)),'Total Data'!D:D,0))

but i just get a #N/A error


回答1:


Use this formula: Press Ctr+Shift+Enter after entering formula.

=INDEX(A1:A5,MAX(IF(A1:B5=MAX(A1:B5),ROW(A1:B5)-ROW(A1)+1)))

Screenshot



来源:https://stackoverflow.com/questions/34055145/find-max-value-in-column-if-meets-criteria-and-return-corresponding-cell-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!