condition formatting to find the highest and runner up numbers

mwvirk

Board Regular
Joined
Mar 2, 2011
Messages
247
Office Version
  1. 2016
Platform
  1. Windows
i have numbers in cell A1 to A35
i am using the condition formatting 'TOP' (1) to find the highest number but i cannot find a way to find the runner-up number
please help. thanks

10
9
20
21
22
33 so here, it's the highest number and i can find it with TOP 1
1
0
6
32 and here is the next (runner up) number. how can i mark it.
22


118,000
27.44%
50,000​
11.63%
40,000​
9.30%
0​
0.00%
50,000​
11.63%
16,100​
3.74%
118,001
27.44%
5,000​
1.16%
8,000​
1.86%
5,000​
1.16%
20,000​
4.65%
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If you want to format both the largest, and second largest values in exactly the same way, then you could use CF but choose the option to "Use a formula to determine which cells to format".

Then, if your data is in the range A1:A11, use a formula like this -
=OR(A1=MAX(A$1:A$11),A1=LARGE(A$1:A$11,2))

And apply a format as required.

If you want the highest and second highest values to be formated differently from each other, apply two conditional formats, one using the MAX part of the above (or your current format) and one using the LARGE part.

This may not work as you would like, if the MAX and second highest values might be duplicated.
 
Upvote 0
Solution
If you want to format both the largest, and second largest values in exactly the same way, then you could use CF but choose the option to "Use a formula to determine which cells to format".

Then, if your data is in the range A1:A11, use a formula like this -
=OR(A1=MAX(A$1:A$11),A1=LARGE(A$1:A$11,2))

And apply a format as required.

If you want the highest and second highest values to be formated differently from each other, apply two conditional formats, one using the MAX part of the above (or your current format) and one using the LARGE part.

This may not work as you would like, if the MAX and second highest values might be duplicated.
thank you. it worked but i want to mark #1 in green and #2 in red. but here it mark both in read


L RowM Row
Votes% Of Candidate Votes
118,000​
18.76%
50,000​
7.95%
119,000​
18.92%
120,000​
19.07%
50,000​
7.95%
16,100​
2.56%
118,001​
18.76%
5,000​
0.79%
8,000​
1.27%
5,000​
0.79%
20,000​
3.18%
 
Upvote 0
If you want to format both the largest, and second largest values in exactly the same way, then you could use CF but choose the option to "Use a formula to determine which cells to format".

Then, if your data is in the range A1:A11, use a formula like this -
=OR(A1=MAX(A$1:A$11),A1=LARGE(A$1:A$11,2))

And apply a format as required.

If you want the highest and second highest values to be formated differently from each other, apply two conditional formats, one using the MAX part of the above (or your current format) and one using the LARGE part.

This may not work as you would like, if the MAX and second highest values might be duplicated.
OK.... it worked. i just apply another condition with green colour:
=OR(L3=MAX(L$3:L$13),L3=LARGE(L$3:L$13,1))

bundle of thanks and appreciate your prompt support
 
Upvote 0
I need to ask another question here.

since the highest number is resolved and also the runner-up. how can I take the names of the persons who got the highest and next to the highest person?

I am splitting the sheet into 2 parts (i cannot install XL2BB on my office computer) sorry for this

A Row (merged cell A3 to A13) (values in this range is unique)B Row (merged cell B3 to B13) (values in this range is NOT unique)C Row (merged cell C3 to C13)D Row (merged cell D3 to D13) (values in this range is unique)E Row (merged cell E3 to E13)F Row (merged cell F3 to F13)G Row (merged cell G3 to G13)H Row (merged cell H3 to H13)I Row (merged cell I3 to I13)
NA # (2018)ProvinceNA # (2013)Seat NameRegistered VotersTotal Cast VotesRejected VotesValid Cast Votes% Of Total Registered Votes
NA-001Area-1NA-032

(Tribal Areas IV)

City-1
City-1318,150245,602500245,10277.20%













J RowK RowL RowM RowN RowO RowP RowQ Row
Candidate NamePartyVotes% Of Candidate VotesWinner's NameWinner PartyRunner up NameRunner up Party
Candiate 001Party 1
18,000​
7.34%
Candiate 002Party 2
50,000​
20.40%
Candiate 003Party 3
19,000​
7.75%
Candiate 004Party 4
20,000​
8.16%
Candiate 005Party 5
50,001​
20.40%
Candiate 006Party 6
16,100​
6.57%
Candiate 007Independent
18,001​
7.34%
Candiate 008Party 7
21,000​
8.57%
Candiate 009Independent
8,000​
3.26%
Candiate 010Independent
5,000​
2.04%
Candiate 011Party 8
20,000​
8.16%


1652955898414.png



1652955936701.png


1652955957359.png
 
Upvote 0
Something like this for the highest -

=index(J2:J100,match(MAX(L2:L100),L2:L100,0)

where col J has the names, and col L has the number of votes.

From this, and from previous posts in this thread, you should be able to work out how to show the name for the second highest number of votes.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: find the winner name from highest numbers
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Something like this for the highest -

=index(J2:J100,match(MAX(L2:L100),L2:L100,0)

where col J has the names, and col L has the number of votes.

From this, and from previous posts in this thread, you should be able to work out how to show the name for the second highest number of votes.
thanks dude. i tried the
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: find the winner name from highest numbers
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
yes. sorry for the inconvenience. it was posted there and i found that there is no reply. i tried removing it but failed.
 
Upvote 0

Forum statistics

Threads
1,214,892
Messages
6,122,112
Members
449,066
Latest member
Andyg666

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