condition formatting to find the highest and runner up numbers

mwvirk

Active Member
Joined
Mar 2, 2011
Messages
252
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%
 
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.
i tried this formula for the runner-up but it didn't work:

=INDEX(J3:J13,MATCH(MAX(L3:L13),L3:L13,1))
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
i tried this formula for the runner-up but it didn't work:

=INDEX(J3:J13,MATCH(MAX(L3:L13),L3:L13,1))
That's because it uses the MAX function, which is good for finding the MAXimum value.
You need to use the LARGE function instead.
 
Upvote 0
That's because it uses the MAX function, which is good for finding the MAXimum value.
You need to use the LARGE function instead.
thanks for your reply.
you mean i have to change the formulas for the winner (name & party) and then runner-up and party?
if possible, may i request you to please share the correct formulas so i can close this task.
thanks
 
Upvote 0
Yes, that's what I mean.
An example of the LARGE function was given in post #3 in this thread, as part of a larger solution.
Another very similar example of the LARGE function was given by another user in post #2 in this thread.
 
Upvote 0
I cannot fix the runner-up issue.
post #2 & #3 you are referring to only to find the max number. but here i need the name based on the higher number.
thank you once again for the kind support.
 
Upvote 0
post #2 & #3 you are referring to only to find the max number.

No, that's not correct.

Post #2 in this thread (by user kvsrinivasamurthy) was specifically about finding the 2nd largest number in a range.

And post #3 was about highlighting the largest and 2nd largest numbers in a range.
The part of that solution that dealt with the 2nd largest number was basically the same as the solution in post #2.
 
Upvote 0
look... i need the name from Row 'J' in Row 'P' and party name from Row 'K' in Row 'Q' as a runner-up name and party
the one showing in Row 'N' & 'O' are correct but Row 'P' & 'Q' are wrong

formula in Row N =INDEX(J3:J13,MATCH(MAX(L3:L13),L3:L13,0))
formula in Row O =INDEX(K3:K13,MATCH(MAX(L3:L13),L3:L13,0))
formula in Row P =INDEX(J3:J13,MATCH(MAX(L3:L13),L3:L13,1))
formula in Row Q =INDEX(K3:K13,MATCH(MAX(L3:L13),L3:L13,1))

1652968240152.png
 
Upvote 0
So, for columns P and Q, replace the MAX part of your function, with the LARGE function that was suggested in posts 2 and 3.
 
Upvote 0
finally it's DONE :)
you can see the formula.
for winner, i am still using MAX
and for the runner-up, i am using LARGE
Thanks a lot for the help.

1652970573818.png
 
Upvote 0
I have completed the sheet and found that the entire record is showing the results as per requirements but when I copy the cells/values in the next record then it's not working properly:

error indicator in H N O P Q
in L, it's not marking the highest number in green
in L, it's not marking the lowest number in red
in N & O it's showing the winner candidate and party name but still showing an error indicator
in P & Q it's not showing the runner up candidate and party name and showing an error indicator

in short, all formulas, and condition checks are working only for the 1st record - Need help again, please. Thanks

1653083053258.png


1653083117849.png




Test-0001.xlsx
ABCDEFGHIJKLMNOPQ
1NA # (2018)ProvinceNA # (2013)Seat NameRegistered VotersTotal Cast VotesRejected VotesValid Cast Votes% Of Total Registered VotesCandidate NameParty NameVotes% Of Candidate VotesWinner's NameWinner PartyRunner up NameRunner up Party
2NA-001Province-1Name-001Area-001318,150100,085,257500100,084,75731458.51%Candidate Name 0001Party Name AA1,0000.00%Candidate Name 0013Party Name AMCandidate Name 0006Party Name AF
3Candidate Name 0002Party Name AB5000.00%
4Candidate Name 0003Party Name AC20.00%
5Candidate Name 0004Party Name AD9990.00%
6Candidate Name 0005Party Name AE40.00%
7Candidate Name 0006Party Name AF27,3000.03%
8Candidate Name 0007Party Name AG60.00%
9Candidate Name 0008Party Name AH70.00%
10Candidate Name 0009Party Name AI27,3000.03%
11Candidate Name 0010Party Name AJ100.00%
12Candidate Name 0011Party Name AK110.00%
13Candidate Name 0012Party Name AL120.00%
14Candidate Name 0013Party Name AM99,999,99999.92%
15Candidate Name 0014Party Name AN140.00%
16Candidate Name 0015Party Name AO150.00%
17Candidate Name 0016Party Name AP160.00%
18Candidate Name 0017Party Name AQ170.00%
19Candidate Name 0018Party Name AR180.00%
20Candidate Name 0019Party Name AS190.00%
21Candidate Name 0020Party Name AT200.00%
22Candidate Name 0021Party Name AU210.00%
23Candidate Name 0022Party Name AV220.00%
24Candidate Name 0023Party Name AW230.00%
25Candidate Name 0024Party Name AX240.00%
26Candidate Name 0025Party Name AY250.00%
27Candidate Name 0026Party Name AZ260.00%
28Candidate Name 0027Party Name BA27,3000.03%
29Candidate Name 0028Party Name BB280.00%
30Candidate Name 0029Party Name BC90.00%
31Candidate Name 0030Party Name BD100.00%
32NA-002Province-1Name-002Area-002318,15010,069,17450010,068,6743164.91%Candidate Name 0001Party Name AA1,0000.00%Candidate Name 0017Party Name AQ#N/A#N/A
33Candidate Name 0002Party Name AB5000.00%
34Candidate Name 0003Party Name AC20.00%
35Candidate Name 0004Party Name AD33,3330.03%
36Candidate Name 0005Party Name AE44,4440.04%
37Candidate Name 0006Party Name AF270.00%
38Candidate Name 0007Party Name AG60.00%
39Candidate Name 0008Party Name AH70.00%
40Candidate Name 0009Party Name AI220.00%
41Candidate Name 0010Party Name AJ100.00%
42Candidate Name 0011Party Name AK110.00%
43Candidate Name 0012Party Name AL120.00%
44Candidate Name 0013Party Name AM990.00%
45Candidate Name 0014Party Name AN140.00%
46Candidate Name 0015Party Name AO150.00%
47Candidate Name 0016Party Name AP160.00%
48Candidate Name 0017Party Name AQ9,988,8889.98%
49Candidate Name 0018Party Name AR180.00%
50Candidate Name 0019Party Name AS190.00%
51Candidate Name 0020Party Name AT200.00%
52Candidate Name 0021Party Name AU210.00%
53Candidate Name 0022Party Name AV220.00%
54Candidate Name 0023Party Name AW230.00%
55Candidate Name 0024Party Name AX240.00%
56Candidate Name 0025Party Name AY250.00%
57Candidate Name 0026Party Name AZ260.00%
58Candidate Name 0027Party Name BA230.00%
59Candidate Name 0028Party Name BB280.00%
60Candidate Name 0029Party Name BC90.00%
61Candidate Name 0030Party Name BD100.00%
62NA-003Province-1Name-003Area-003Candidate Name 0001Party Name AA
63Candidate Name 0002Party Name AB
64Candidate Name 0003Party Name AC
65Candidate Name 0004Party Name AD
66Candidate Name 0005Party Name AE
67Candidate Name 0006Party Name AF
68Candidate Name 0007Party Name AG
69Candidate Name 0008Party Name AH
70Candidate Name 0009Party Name AI
71Candidate Name 0010Party Name AJ
72Candidate Name 0011Party Name AK
73Candidate Name 0012Party Name AL
74Candidate Name 0013Party Name AM
75Candidate Name 0014Party Name AN
76Candidate Name 0015Party Name AO
77Candidate Name 0016Party Name AP
78Candidate Name 0017Party Name AQ
79Candidate Name 0018Party Name AR
80Candidate Name 0019Party Name AS
81Candidate Name 0020Party Name AT
82Candidate Name 0021Party Name AU
83Candidate Name 0022Party Name AV
84Candidate Name 0023Party Name AW
85Candidate Name 0024Party Name AX
86Candidate Name 0025Party Name AY
87Candidate Name 0026Party Name AZ
88Candidate Name 0027Party Name BA
89Candidate Name 0028Party Name BB
90Candidate Name 0029Party Name BC
91Candidate Name 0030Party Name BD
Election 2018 (MNA)
Cell Formulas
RangeFormula
H2,H32H2=SUM(L2:L31)
I2,I32I2=IF(E2="","",F2/E2)
M2:M61M2=IF(L2="","",L2/$H$2)
N2,N32N2=INDEX(J2:J31,MATCH(MAX(L2:L31),L2:L31,0))
O2,O32O2=INDEX(K2:K31,MATCH(MAX(L2:L31),L2:L31,0))
P2,P32P2=INDEX(J2:J31,MATCH(LARGE($L$2:$L$31,2),L2:L31,0))
Q2,Q32Q2=INDEX(K2:K31,MATCH(LARGE($L$2:$L$31,2),L2:L31,0))
F2,F32F2=H2+G2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L32:M61Expression=OR(L32=MAX(L$2:L$31),L32=LARGE(L$2:L$31,1))textNO
L32:M61Expression=OR(L32=MAX(L$2:L$31),L32=LARGE(L$2:L$31,2))textNO
F32:F61Cell Value>$E$2textNO
F32:F61Cell Value>0textNO
H32:H61Cell Value>$E$2textNO
L2:M31Expression=OR(L2=MAX(L$2:L$31),L2=LARGE(L$2:L$31,1))textNO
L2:M31Expression=OR(L2=MAX(L$2:L$31),L2=LARGE(L$2:L$31,2))textNO
F2:F31Cell Value>$E$2textNO
F2:F31Cell Value>0textNO
H2:H31Cell Value>$E$2textNO
 
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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