# Return the Greatest Value in a Range

#### maic15

##### Active Member
Hello,

I have a issue that I hope some can help me. I need to tax the max value of the "# of Unique providers for a durations" field and return the value from "Provider-Level Duration" in a seperate column.

I have three columns with three records:
ID:
Provider-Level Duration:
# of Unique providers for a durations:

The values in the field are the following:
ID:
CAR INST FOR DEV DISABILITIESNEW MEDICAL CONSULTATION15
CAR INST FOR DEV DISABILITIESNEW MEDICAL CONSULTATION180
CAR INST FOR DEV DISABILITIESNEW MEDICAL CONSULTATION120
Provider-Level Duration:
9
1
10
# of Unique providers for a durations:
15
180
120

I'm looking for the following result:
ID: CAR INST FOR DEV DISABILITIESNEW MEDICAL CONSULTATION120
Provider-Level Duration: 10 (This is the max value of the three records
# of Unique providers for a durations:120

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### LarryLegend

##### New Member
If I understand correctly, you want to look for the maximum value in Column B (Provider-Level Duration) and then based on that, pull the corresponding information from Column A (ID) and Column C: (# of Unique providers for a durations) from the same row as your match in Column B. Is that correct?

If so, can you also let me know if the values in Column B unique? For example, is there a case where multiple records might have the same maximum value for Column B (Provider-Level Duration) ?

#### maic15

##### Active Member
Correct. Column A (ID) will have unquie values. I mistyped "CAR INST FOR DEV DISABILITIESNEW MEDICAL CONSULTATION"

#### LarryLegend

##### New Member
To determine the maximum value in Column B, you can use this formula in cell D2: =max(b:b)

To then pull in the corresponding value from Column A: =INDEX(A:A,MATCH(D2,B:B,FALSE),1)
To then pull in the corresponding value from Column C: =INDEX(C:C,MATCH(D2,B:B,FALSE),1)

#### maic15

##### Active Member

I think I stated it wrong. I need a 1 enter into a cell in column D that matches my logic.

For example, in an array A2:A4, take the max of C2:C4, and return a value of B2:B4, that matches the max of C2:C4

#### LarryLegend

##### New Member
If I understand correctly, you are looking for the greatest value in Column C and then pulling the corresponding data in Column B from the same row that the max C value was found. If you want it all in a single cell you could do =INDEX(B:B,MATCH(MAX(C:C),C:C,FALSE),1)

##### MrExcel MVP
I think I stated it wrong. I need a 1 enter into a cell in column D that matches my logic.

For example, in an array A2:A4, take the max of C2:C4, and return a value of B2:B4, that matches the max of C2:C4

And that value is?

Replies
13
Views
197
Replies
3
Views
78
Replies
3
Views
219
Replies
1
Views
58
Replies
3
Views
129

1,126,994
Messages
5,622,053
Members
415,875
Latest member
Tarali

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back