问题
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