Find row for max value of all columns in a pivot table

rabiamalik

New Member
Joined
Apr 26, 2016
Messages
1
Hi,

I have a pivot table as follows:

A B C D
1 company name country1 country2 country3 ...
2 company1 10 2 3
3 company2 1 35 5
4 company3 0 4 10

I find the highest export quantity in all countries by the formula max(B2:D4) which comes out as 35.

Now I want to find the company name corresponding to this max value.

Need urgent help with this please. I've spent several hours on just this question of my project.

Regards
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi,

(replace ; with your usual separator (ie ,) where appropriate:
Code:
=INDEX($A$1:$A$4; SUMPRODUCT((B3:D4=MAX(B3:D4))*ROW(B3:D4)); 1)
Regards
XLearner
 
Upvote 0
Hi,

In case you would have 2 (or more) Companies with the same MAX value the following formula is more robust in the sense it will report the 1st one found instead of an error:

Code:
=INDEX($A$1:$A$4; SMALL(IF(B2:D4=MAX(B2:D4);ROW(B2:D4));1); 1)
validate it with [Ctrl]+[Shift]+[Enter] as this is an array formula

AND in the previous proposal it's not ((B3:D4=MAX(B3:D4))*ROW(B3:D4)) but ((B2:D4=MAX(B2:D4))*ROW(B2:D4)) - Sorry :(

Regards
XLearner
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,837
Members
449,193
Latest member
MikeVol

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