find the highest value in a column and match the top 3 highest value in another column

Leda Leong

New Member
Joined
Sep 25, 2017
Messages
11
Dear all,

I have try the below calculation method to count the highest value but it failed. it can only count the top 1 instead of top 3, suppose the top one in column E should be FIX and to find the Top 3 highest value which match FIX in column F should be SINK, SHOWER, FURN, but I failed, can another one help?
=LOOKUP(1,0/FREQUENCY(0,1/(1+COUNTIFS($E$2:$E$5311,'RAW DATA (1)'!O1,F2:F5311,F2:F5311,F2:F5311,"<>0"))),F2:F5311)


DATEJ-DayMONTHStatus 狀態RemedyProblem
1-Sep2459COMPFIXPOWERFAIL
1-Sep2459COMPDONEGUEST
1-Sep2459COMPMOTOR-RAC-NOISY
1-Sep2459COMPFIXHINGE
1-Sep2459COMPFIXTIMELOX
1-Sep2459COMPFIXSHOWER
1-Sep2459COMPFIXHINGE
1-Sep2459COMPFIXSINK
1-Sep2459COMPBATTERYTIMELOX
1-Sep2459COMPPAINTPAINTP
1-Sep2459COMPPAINTPAINTP
1-Sep2459COMPMOVEFURN
1-Sep2459COMPPAINTPAINTP
1-Sep2459COMPFIXFURN
1-Sep2459COMPFIXDHARDWARE
1-Sep2459COMPFIXDHARDWARE
1-Sep2459COMPFIXDHARDWARE
1-Sep2459COMPDAMPER-FAC-NOISY
1-Sep2459COMPBLOW-FAC-NOISY
1-Sep2459COMPBLOW-FAC-NOISY
1-Sep2459COMPFIXCARPET
1-Sep2459COMPREPLACEFURN
1-Sep2459COMPB-LEDNOLIGHT
1-Sep2459COMPBLOW-FACHOT
1-Sep2459COMPVAVBOX-RACHOT
1-Sep2459COMPFIXSHOWER
1-Sep2459COMPFIXSHOWER
1-Sep2459COMPB-LEDNOLIGHT
1-Sep2459COMPFIXSINK
1-Sep2459COMPFIXPRODUCTION
1-Sep2459COMPFIXCARPET

<colgroup><col width="96" style="width: 72pt; mso-width-source: userset; mso-width-alt: 3510;" span="5"> <col width="111" style="width: 83pt; mso-width-source: userset; mso-width-alt: 4059;"> <tbody>
</tbody>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Welcome to Mr Excel

Not clear what you are looking for.
Questions:
Do you want to list the 3 most frequent values in column F whose value in column E = FIX?
RAW DATA (1)'!O1 = FIX?
Considering the data sample above, the results would be?
SHOWER
DHARDWARE
HINGE

M.
 
Last edited:
Upvote 0
Welcome to Mr Excel

Not clear what you are looking for.
Questions:
Do you want to list the 3 most frequent values in column F whose value in column E = FIX?
RAW DATA (1)'!O1 = FIX?
Considering the data sample above, the results would be?
SHOWER
DHARDWARE
HINGE

M.


I would like to ask, if base on column E, the highest value is FIX, I would like to find out the top 3 highest value in column F, which results would be DHARDWARE, SHOWER AND CARPET, I can do it by Pivot table but don't know how to set up a formula

RemedyFIX
Row LabelsCount of Remedy
Grand Total16
DHARDWARE3
SHOWER3
CARPET2
HINGE2
SINK2
FURN1
POWERFAIL1
PRODUCTION1
TIMELOX1

<tbody>
</tbody><colgroup><col><col></colgroup>
 
Upvote 0
Filter >> Top 10

Change 10 to 3.

Sort Z >> A on Count of Remedy

Row\Col
A​
B​
1​
RemedyFIX
2​
3​
Row LabelsCount of Remedy
4​
SHOWER
3​
5​
DHARDWARE
3​
6​
SINK
2​
7​
CARPET
2​
8​
HINGE
2​
9​
Grand Total
12
 
Upvote 0
thanks, but I would like a formula instead of using pivot table, would you please kindly teach me? thanks
 
Upvote 0
Maybe this


H
I
J
1
Remedy​
List​
Count​
2
FIX​
SHOWER​
3​
3
DHARDWARE​
3​
4
HINGE​
2​
5
SINK​
2​
6
CARPET​
2​
7
POWERFAIL​
1​
8
TIMELOX​
1​
9
FURN​
1​
10
PRODUCTION​
1​

Array formula in I2 copied down
=IFERROR(INDEX(F$2:F$5311,MODE(IF(E$2:E$5311=H$2,IF(ISNA(MATCH(F$2:F$5311,I$1:I1,0)),MATCH(F$2:F$5311,F$2:F$5311,0)+{0,0})))),"")
Ctrl+Shift+.Enter

Regular formula in J2 copied down
=IF(I2="","",COUNTIFS(E$2:E$5311,H$2,F$2:F$5311,I2))

Hope this helps

M.
 
Upvote 0
no, sorry, it failed, can I just type the below 2 column,
I would like to find the highest frequency in column E which answer is FIX.
and based on FIX, I would like to know the highest frequency for FIX in column F, and the answer should be SINK, ACHOT, AC-NOISY.

=LOOKUP(1,0/FREQUENCY(0,1/(1+COUNTIFS($E$2:$E$5311,'RAW DATA (1)'!O1,F2:F5311,F2:F5311,F2:F5311,"<>0"))),F2:F5311)

I Tried the above formula but it can only count SINK for me, but actually I would like to know the top 3 value for FIX in column F,

Can anyone help, million thanks


Column E Column F
RemedyProblem
FIXPOWERFAIL
DONEGUEST
MOTOR-RAC-NOISY
FIXHINGE
FIXTIMELOX
FIXSHOWER
FIXHINGE
FIXSINK
BATTERYTIMELOX
PAINTPAINTP
PAINTPAINTP
MOVEFURN
PAINTPAINTP
FIXFURN
FIXDHARDWARE
FIXDHARDWARE
FIXDHARDWARE
DAMPER-FAC-NOISY
BLOW-FAC-NOISY
BLOW-FAC-NOISY
FIXCARPET
REPLACEFURN
B-LEDNOLIGHT
BLOW-FACHOT
VAVBOX-RACHOT
FIXSHOWER
FIXSHOWER
B-LEDNOLIGHT
FIXSINK
FIXPRODUCTION
FIXCARPET
FIXDHARDWARE
FIXSINK
ACTVAL-RACHOT
AIRDUCT-FACHOT
FIXSINK
ZR-OTHERFITTING
PAINTPAINTP
FIXCARPET
FIXDOORP
PAINTFURN
OPENSAFE
FIXLATCH
FIXTOILET
FIXSINK
B-OTHNOLIGHT
FIXSINK
0MARBLE
PAINTPANELS

<colgroup><col width="64" style="width: 48pt;" span="2"> <tbody>
</tbody>
 
Upvote 0
thanks, but I would like a formula instead of using pivot table, would you please kindly teach me? thanks

Something from my own *******...

Row\Col
A​
B​
C​
D​
E​
F​
I​
1​
DATE J-Day MONTH Status 狀態 Remedy Problem
3​
2​
1-Sep 245 9 COMP FIX POWERFAILFIX
3​
1-Sep 245 9 COMP DONE GUESTTop Problems
4​
1-Sep 245 9 COMP MOTOR-R AC-NOISYSHOWER
5​
1-Sep 245 9 COMP FIX HINGEDHARDWARE
6​
1-Sep 245 9 COMP FIX TIMELOXHINGE
7​
1-Sep 245 9 COMP FIX SHOWERSINK
8​
1-Sep 245 9 COMP FIX HINGECARPET
9​
1-Sep 245 9 COMP FIX SINK
10​
1-Sep 245 9 COMP BATTERY TIMELOX
11​
1-Sep 245 9 COMP PAINT PAINTP
12​
1-Sep 245 9 COMP PAINT PAINTP
13​
1-Sep 245 9 COMP MOVE FURN
14​
1-Sep 245 9 COMP PAINT PAINTP
15​
1-Sep 245 9 COMP FIX FURN
16​
1-Sep 245 9 COMP FIX DHARDWARE
17​
1-Sep 245 9 COMP FIX DHARDWARE
18​
1-Sep 245 9 COMP FIX DHARDWARE
19​
1-Sep 245 9 COMP DAMPER-F AC-NOISY
20​
1-Sep 245 9 COMP BLOW-F AC-NOISY
21​
1-Sep 245 9 COMP BLOW-F AC-NOISY
22​
1-Sep 245 9 COMP FIX CARPET
23​
1-Sep 245 9 COMP REPLACE FURN
24​
1-Sep 245 9 COMP B-LED NOLIGHT
25​
1-Sep 245 9 COMP BLOW-F ACHOT
26​
1-Sep 245 9 COMP VAVBOX-R ACHOT
27​
1-Sep 245 9 COMP FIX SHOWER
28​
1-Sep 245 9 COMP FIX SHOWER
29​
1-Sep 245 9 COMP B-LED NOLIGHT
30​
1-Sep 245 9 COMP FIX SINK
31​
1-Sep 245 9 COMP FIX PRODUCTION
32​
1-Sep 245 9 COMP FIX CARPET

1. Define Problem in the Name Manager as referring to:

=Sheet1!$F$2:$F$32

2. Define Remedy in the Name Manager as referring to:

=Sheet1!$E$2:$E$32

Adjust the sheet name as it suits.

3. Define Ivec in the Name Manager as referring to:

=ROW(Problem)-ROW(INDEX(Problem,1,1))+1

4. Define ProblemSet in the Name Manager as referring to:

=FREQUENCY(IF(1-(Problem=""),IF(Remedy=Sheet1!$I$2,MATCH(Problem,Problem,0))),Ivec)

where Sheet1!$I$2 houses a remedy of interest like FIX.

5. I1 houses Top N of interest where N = 3.

6. I2 houses, as said above, a remedy which is here set to FIX.

7. In I4 control+shift+enter, not just enter, and copy down:

=IF(ROWS($I$4:I4)>SUM(IF(LARGE(ProblemSet,Ivec)>=LARGE(ProblemSet,$I$1),1)),"",INDEX(Problem,SMALL(IF(ProblemSet=LARGE(ProblemSet,ROWS($I$4:I4)),Ivec),SUM(IF(LARGE(ProblemSet,ROW($I$4:I4)-ROW($I$4)+1)=LARGE(ProblemSet,ROWS($I$4:I4)),1)))))
 
Upvote 0
no, sorry, it failed, can I just type the below 2 column,
I would like to find the highest frequency in column E which answer is FIX.
and based on FIX, I would like to know the highest frequency for FIX in column F, and the answer should be SINK, ACHOT, AC-NOISY.

I do not understand why ACHOT and AC-NOISY? In the data sample you showed there is no match between them and FIX.

Could you clarify?

The formulas in post #6 worked perfectly for me. The formula in column I must be confirmed with Ctrl+Shift+Enter, not just with Enter.

M.
 
Upvote 0
Maybe this



H

I

J

1

Remedy​

List​

Count​

2

FIX​

SHOWER​

3​

3

DHARDWARE​

3​

4

HINGE​

2​

5

SINK​

2​

6

CARPET​

2​

7

POWERFAIL​

1​

8

TIMELOX​

1​

9

FURN​

1​

10

PRODUCTION​

1​

<tbody>
</tbody>


Array formula in I2 copied down
=IFERROR(INDEX(F$2:F$5311,MODE(IF(E$2:E$5311=H$2,IF(ISNA(MATCH(F$2:F$5311,I$1:I1,0)),MATCH(F$2:F$5311,F$2:F$5311,0)+{0,0})))),"")
Ctrl+Shift+.Enter

Regular formula in J2 copied down
=IF(I2="","",COUNTIFS(E$2:E$5311,H$2,F$2:F$5311,I2))

Hope this helps

M.

thank you so much, it really works, really want burst to cry, thank you thank you
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,021
Members
449,414
Latest member
sameri

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