[TABLE="class: cms_table, width: 240"]
<tbody>[TR]
[TD]Phone[/TD]
[TD]Country[/TD]
[TD]Count If[/TD]
[TD]Launch[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD]1[/TD]
[TD]Apr 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD]2[/TD]
[TD]Apr 2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Vietnam[/TD]
[TD]1[/TD]
[TD]Mar 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]China[/TD]
[TD]1[/TD]
[TD]Jun 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Singapore[/TD]
[TD]1[/TD]
[TD]Apr 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]China[/TD]
[TD]1[/TD]
[TD]Aug 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Turkey[/TD]
[TD]1[/TD]
[TD]Jun 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Turkey[/TD]
[TD]2[/TD]
[TD]Jul 2018
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="class: cms_table, width: 240"]
<tbody>[TR]
[TD]Phone[/TD]
[TD]Country[/TD]
[TD]Launch[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD="align: right"]Apr 2018[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Vietnam[/TD]
[TD="align: right"]Mar 2019[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]China[/TD]
[TD="align: right"]Jun 2019[/TD]
[/TR]
</tbody>[/TABLE]
<tbody>[TR]
[TD]Phone[/TD]
[TD]Country[/TD]
[TD]Count If[/TD]
[TD]Launch[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD]1[/TD]
[TD]Apr 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD]2[/TD]
[TD]Apr 2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Vietnam[/TD]
[TD]1[/TD]
[TD]Mar 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]China[/TD]
[TD]1[/TD]
[TD]Jun 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Singapore[/TD]
[TD]1[/TD]
[TD]Apr 2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]China[/TD]
[TD]1[/TD]
[TD]Aug 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Turkey[/TD]
[TD]1[/TD]
[TD]Jun 2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Samsung[/TD]
[TD]Turkey[/TD]
[TD]2[/TD]
[TD]Jul 2018
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="class: cms_table, width: 240"]
<tbody>[TR]
[TD]Phone[/TD]
[TD]Country[/TD]
[TD]Launch[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Singapore[/TD]
[TD="align: right"]Apr 2018[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]Vietnam[/TD]
[TD="align: right"]Mar 2019[/TD]
[/TR]
[TR]
[TD]Iphone[/TD]
[TD]China[/TD]
[TD="align: right"]Jun 2019[/TD]
[/TR]
</tbody>[/TABLE]