Returning Adjacent Cell with Max(IF

pmolan

New Member
Joined
Dec 15, 2017
Messages
2
Office 365
I am working with a large spreadsheet that changes monthly. I prefer my code to be dynamic because the quantity of data changes each month. I have a summary page that displays the MAX of each ITEM.
I am currently using MAX(IF to find these values. I would like to also display the adjacent cells (to the left) of the found MAX value.

The data is structured something like this:

ITEMColumn 1Column 2Column 3
Apple2579.2
Apple3639.3
Apple46915
Apple5819.2
Apple6878.8
Plum25715
Plum3638.5
Plum4697.9
Plum5818.8
Plum6878.7
<colgroup><col width="62" style="width: 47pt;"> <col width="62" style="width: 47pt;" span="2"> <col width="62" style="width: 47pt;"> <tbody> </tbody>


On the summary page, B35 = "Plum" in the following code
The formula that I am using is:
=MAX(IF('Combined Data'!$A:$A=B35,'Combined Data'!$D:$D)) (CTRL + SHIFT + ENTER)
this returns a value of 15 which is correct

I would like to display columns B and C in my report as well
Example:

B35
Plum 2 57 15

I have tried code like
=INDEX('Combined Data'!$B:$B,MATCH(MAX(IF('Combined Data'!$A:$A=B35,'Combined Data'!$D:$D)),'Combined Data'!$D:$D,0))
This results in erroneous data such as

B35
Plum 4 69 15

because it is returning the first value that it finds in column B that has 15 in column D.

I know there is a simpler way with OFFSET etc.. but I just cant seem to get it to work with MAX(IF.

I hope that this is clear.

Thanks.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You can't just assume that the plum and 15 combination occurs just once. So, a single output record like Plum 2 57 15 won't work. Just replace 8.8 in column D of Combined Data with 15 to see what I mean.
 
Upvote 0
Thank you for your reply. I agree there may be multiple 15’s. I am only interested in the first occurrence at the moment.
 
Upvote 0

Forum statistics

Threads
1,217,004
Messages
6,133,972
Members
449,850
Latest member
ali_jellybean

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top