Select a maximum value from a column which has repeated values

rac241985

New Member
Joined
Jan 30, 2017
Messages
27
PhoneCountryCount IfLaunch
IphoneSingapore1Apr 2017
IphoneSingapore2Apr 2018
IphoneVietnam1Mar 2019
IphoneChina1Jun 2019
SamsungSingapore1Apr 2019
SamsungChina1Aug 2017
SamsungTurkey1Jun 2017
SamsungTurkey2Jul 2018

<tbody>
</tbody>


Count if Formula used: COUNTIF($B$1:B1,B1)

I have 4 columns as shown above. In column B, the country maybe repeated twice. I tried to use the count if function as shown above. I am not sure how to extract the maximum number and show the output based on that as follows if the user selects Iphone. I know how to extract the first time the value occurs (i.e. when Output is "1"). Not sure how to extract it for the maximum number. Can someone please help


Desired Output:
PhoneCountryLaunch
IphoneSingaporeApr 2018
IphoneVietnamMar 2019
IphoneChinaJun 2019

<tbody>
</tbody>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
PhoneCountryCount IfLaunchIphone
IphoneSingapore1Apr-173
IphoneSingapore2Apr-18countrylaunch
IphoneVietnam1Mar-19SingaporeApr-18
IphoneChina1Jun-19VietnamMar-19
SamsungSingapore1Apr-19ChinaJun-19
SamsungChina1Aug-17
SamsungTurkey1Jun-17
SamsungTurkey2Jul-18

<tbody>
</tbody>

In F2 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($B$2:$B$9=""),IF($A$2:$A$9=F$1,MATCH($B$2:$B$9,$B$2:$B$9,0))),ROW($B$2:$B$9)-ROW($B$2)+1),1))

In F4 control+shift+enter, not just enter, and copy down:

=IF(ROWS($F$4:F4)>$F$2,"",INDEX($B$2:$B$9,SMALL(IF(FREQUENCY(IF(1-($B$2:$B$9=""),IF($A$2:$A$9=F$1,MATCH($B$2:$B$9,$B$2:$B$9,0))),ROW($B$2:$B$9)-ROW($B$2)+1),ROW($B$2:$B$9)-ROW($B$2)+1),ROWS($F$4:F4))))

In G4 control+shift+enter, not just enter, and copy down:

=IF($F4="","",MAX(IF($A$2:$A$9=$F$1,IF($B$2:$B$9=$F4,$D$2:$D$9))))

If you have MAXIFS available on your system, you can invoke in G4 which needs just enter...

=IF($F4="","",MAXIFS($D$2:$D$9,$A$2:$A$9,$F$1,$B$2:$B$9,$F4))

and copy down.
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,308
Members
448,886
Latest member
GBCTeacher

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