Help with rank using countifs?

cspengel

Board Regular
Joined
Oct 29, 2022
Messages
173
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I did a little reading on the subject, but cannot quite find how to do it if my criteria range is more than one column. The formula I have in mind is something like this:

=COUNTIFS(criteria_range,criteria,values,">"&value)+1

Suppose my data contains a list of names on a sheet called "Salary" in column B. This is not the main sheet, but a secondary sheet.

correlationattempt2.xlsm
B
1Name
2Alec Pierce
3Ashton Dulin
4Austin Ekeler
5Cameron Dicker
6Chase McLaughlin
7DeAndre Carter
8Deon Jackson
9Donald Parham Jr.
10Gerald Everett
11Indianapolis Colts
12Jelani Woods
13Jordan Wilkins
14Joshua Kelley
15Joshua Palmer
16Justin Herbert
17Keenan Allen
18Los Angeles Chargers
19Michael Pittman Jr.
20Mike Williams
21Nick Foles
22Parris Campbell
23Zack Moss
Salary


On the main sheet, called "Worksheet", I have data my macro puts out.

correlationattempt2.xlsm
GHIJKLMNOPQRSTUVWXYZAA
1QBFLEXFLEXFLEXFLEXComboIDSalaryProjectionProbabilityTargetDepth TotalTARGET PT 9+Ownership L|UCorrelationValueStackStack POSPlayersFilterPlayer1Player2
2Justin HerbertMichael Pittman Jr.Chase McLaughlinCameron DickerGerald Everett304995600068.325101.28568.74530.05%0.291.220089LACQB,K,TE30
3Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettParris Campbell308465550064.295102.42566.91630.41%0.341.158468LACQB,K,TE30
4Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettAlec Pierce308475450063.91598.91566.4730.45%0.341.172752LACQB,K,TE30
5Austin EkelerJustin HerbertChase McLaughlinCameron DickerGerald Everett351195950073.998.1488.6530.06%0.351.242016LACRB,QB,K,TE40
6Justin HerbertAustin EkelerChase McLaughlinCameron DickerGerald Everett73995950075.47596.52588.6530.06%0.351.268487LACQB,RB,K,TE40
7Austin EkelerJustin HerbertChase McLaughlinCameron DickerParris Campbell351216000072.24124.784.86640.04%0.041.204LACRB,QB,K30
8Austin EkelerJustin HerbertChase McLaughlinCameron DickerAlec Pierce351225900071.86121.1984.35740.05%0.041.217966LACRB,QB,K30
9Justin HerbertAustin EkelerChase McLaughlinCameron DickerParris Campbell74016000073.815123.08584.86640.04%0.041.23025LACQB,RB,K30
10Justin HerbertAustin EkelerChase McLaughlinCameron DickerAlec Pierce74025900073.435119.57584.35740.05%0.041.244661LACQB,RB,K30
11Austin EkelerJustin HerbertChase McLaughlinGerald EverettParris Campbell351365950070.61124.788.13640.59%0.271.186722LACRB,QB,TE30
12Austin EkelerJustin HerbertChase McLaughlinGerald EverettAlec Pierce351375850070.23121.1987.62740.65%0.271.200512LACRB,QB,TE30
13Justin HerbertAustin EkelerChase McLaughlinGerald EverettParris Campbell74165950072.185123.08588.13640.59%0.271.213193LACQB,RB,TE30
14Justin HerbertAustin EkelerChase McLaughlinGerald EverettAlec Pierce74175850071.805119.57587.62740.65%0.271.227435LACQB,RB,TE30
15Austin EkelerJustin HerbertCameron DickerGerald EverettParris Campbell354665900069.8799.2886.77630.51%0.51.184237LACRB,QB,K,TE40
16Austin EkelerJustin HerbertCameron DickerGerald EverettAlec Pierce354675800069.4995.7786.26730.56%0.51.198103LACRB,QB,K,TE40
17Justin HerbertAustin EkelerCameron DickerGerald EverettParris Campbell77465900071.44597.66586.77630.51%0.51.210932LACQB,RB,K,TE40
18Justin HerbertAustin EkelerCameron DickerGerald EverettAlec Pierce77475800071.06594.15586.26730.56%0.51.225258LACQB,RB,K,TE40
19Austin EkelerMichael Pittman Jr.Chase McLaughlinCameron DickerGerald Everett628395650063.6106.1381.17530.02%-0.051.125663LACRB,K,TE30
20Austin EkelerJustin HerbertCameron DickerParris CampbellAlec Pierce354975850067.83122.3382.52840.41%0.191.159487LACRB,QB,K30
21Justin HerbertAustin EkelerCameron DickerParris CampbellAlec Pierce77775850069.405120.71582.52840.41%0.191.18641LACQB,RB,K30
22Austin EkelerJustin HerbertGerald EverettParris CampbellAlec Pierce358275800066.2122.3385.79845.36%0.391.141379LACRB,QB,TE30
23Justin HerbertAustin EkelerGerald EverettParris CampbellAlec Pierce81075800067.775120.71585.79845.36%0.391.168534LACQB,RB,TE30
24Austin EkelerMichael Pittman Jr.Cameron DickerGerald EverettParris Campbell631865600059.57107.2779.34630.19%0.081.06375LACRB,K,TE30
25Austin EkelerMichael Pittman Jr.Cameron DickerGerald EverettAlec Pierce631875500059.19103.7678.83730.21%0.081.076181LACRB,K,TE30
26Austin EkelerJustin HerbertChase McLaughlinCameron DickerJoshua Kelley351235800071.0698.1474.7630.06%0.041.225172LACRB,QB,K,RB40
27Justin HerbertAustin EkelerChase McLaughlinCameron DickerJoshua Kelley74035800072.63596.52574.7630.06%0.041.252327LACQB,RB,K,RB40
28Austin EkelerJustin HerbertChase McLaughlinGerald EverettJoshua Kelley351385750069.4398.1477.97630.76%0.271.207478LACRB,QB,TE,RB40
29Justin HerbertAustin EkelerChase McLaughlinGerald EverettJoshua Kelley74185750071.00596.52577.97630.76%0.271.234869LACQB,RB,TE,RB40
30Austin EkelerJustin HerbertChase McLaughlinParris CampbellJoshua Kelley351685800067.77124.774.23740.55%-0.041.168448LACRB,QB,RB30
31Austin EkelerJustin HerbertChase McLaughlinAlec PierceJoshua Kelley351835700067.39121.1973.72840.61%-0.041.18228LACRB,QB,RB30
32Justin HerbertAustin EkelerChase McLaughlinParris CampbellJoshua Kelley74485800069.345123.08574.23740.55%-0.041.195603LACQB,RB,RB30
33Justin HerbertAustin EkelerChase McLaughlinAlec PierceJoshua Kelley74635700068.965119.57573.72840.61%-0.041.209912LACQB,RB,RB30
Worksheet
Cell Formulas
RangeFormula
Y2:Y33Y2=IF($AA$2="",COUNTIF(G2:K2,$Z$2),COUNTIF(G2:K2,$Z$2)*COUNTIF(G2:K2,$AA$2))


What I would like to do is rank each row based on Column O for each name on the list. I assume I would have 23 helper columns ( A helper column for each name), unless someone can think of a better solution. The only criteria is that the row must contain the name it is ranking between columns G:K, otherwise it does not rank it at all. Thanks for any assistance!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
What I am trying to accomplish in the end is having each player in the list have their top 30 probability rows kept and everything else deleted. However, I am trying to break this down. This is what I had in mind:

correlationattempt2.xlsm
GHIJKLM
2Justin HerbertMichael Pittman Jr.Chase McLaughlinCameron DickerGerald Everett01240
3Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettParris Campbell01197
4Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettAlec Pierce1524
5Austin EkelerJustin HerbertChase McLaughlinCameron DickerGerald Everett01387
6Justin HerbertAustin EkelerChase McLaughlinCameron DickerGerald Everett01454
7Austin EkelerJustin HerbertChase McLaughlinCameron DickerParris Campbell0787
8Austin EkelerJustin HerbertChase McLaughlinCameron DickerAlec Pierce1414
9Justin HerbertAustin EkelerChase McLaughlinCameron DickerParris Campbell0846
10Justin HerbertAustin EkelerChase McLaughlinCameron DickerAlec Pierce1461
11Austin EkelerJustin HerbertChase McLaughlinGerald EverettParris Campbell0787
12Austin EkelerJustin HerbertChase McLaughlinGerald EverettAlec Pierce1414
13Justin HerbertAustin EkelerChase McLaughlinGerald EverettParris Campbell0846
14Justin HerbertAustin EkelerChase McLaughlinGerald EverettAlec Pierce1461
15Austin EkelerJustin HerbertCameron DickerGerald EverettParris Campbell01319
16Austin EkelerJustin HerbertCameron DickerGerald EverettAlec Pierce1574
17Justin HerbertAustin EkelerCameron DickerGerald EverettParris Campbell01402
Worksheet
Cell Formulas
RangeFormula
L2:L17L2=COUNTIF(Worksheet!G2:K2,Salary!$B$2)
M2:M17M2=COUNTIFS(L:L,L2,Q:Q,">"&Q2)+1


The helper columns in L and M are for just one player. So I would need 46 helper columns to do it this way.. Which is kind of ridiculous. Any ideas?
 
Upvote 0
Well, that is kind of what I ended up doing..pain in the you know what.

probattempt1.xlsm
GHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCA
1QBFLEXFLEXFLEXFLEXComboIDSalaryProjectionProbabilityTargetDepth TotalTARGET PT 9+Ownership L|UCorrelationValueStackStack POSPlayersFilterPlayer1Player211223344556677889910101111121213131414151516161717181819192020212122222323242425252626
2Justin HerbertMichael Pittman Jr.Chase McLaughlinCameron DickerGerald Everett304995600068.32599.04568.81530.05%0.291.220089LACQB,K,TE30013030169905481332162301710016410157213700140201704016730169101570157001053012141578099501565012400174501821018210182101821
3Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettParris Campbell308465550064.295100.58567.1630.41%0.341.158468LACQB,K,TE30012520165805351315011900166601590015331357013510165801632016460151915610101701163157009840153315810169701770017700177001770
4Justin HerbertMichael Pittman Jr.Cameron DickerGerald EverettAlec Pierce308475450063.91597.20566.49730.45%0.341.172752LACQB,K,TE301549018030581137301301018170175701664140401518018090177301793016761592011080133015870106301623012850184801019370193701937
5Austin EkelerJustin HerbertChase McLaughlinCameron DickerGerald Everett351195950073.996.5588.57530.06%0.351.242016LACRB,QB,K,TE40014240183311388139016550184701793016911420015540184301803018240171216130112901366013860109501657013040188101973019730197301973
6Justin HerbertAustin EkelerChase McLaughlinCameron DickerGerald Everett73995950075.47595.04588.57530.06%0.351.268487LACQB,RB,K,TE40014640188811437141516930190401858017431441016190190201859018810177216300114901431014510114601697013670194102038020380203802038
7Austin EkelerJustin HerbertChase McLaughlinCameron DickerParris Campbell351216000072.2412284.95640.04%0.041.204LACRB,QB,K3008220113118151142141301125099101029097308540111201106011080966137106620689079106060110014130114101171011710117101171
8Austin EkelerJustin HerbertChase McLaughlinCameron DickerAlec Pierce351225900071.86118.6284.34740.05%0.041.217966LACRB,QB,K3014340130919551179149801294011780119401115097201289012840127601128145907750857095707450126308700131501013580135801358
9Justin HerbertAustin EkelerChase McLaughlinCameron DickerParris Campbell74016000073.815120.49584.95640.04%0.041.23025LACQB,RB,K3008920122918911164145601221010960112201049092101212012060120301055140907260775087506750118914510123701276012760127601276
10Justin HerbertAustin EkelerChase McLaughlinCameron DickerAlec Pierce74025900073.435117.11584.34740.05%0.041.244661LACQB,RB,K30146201352198011871525013340122301234011500100101331013260131701172148607890899099907870130209020135801014030140301403
11Austin EkelerJustin HerbertChase McLaughlinGerald EverettParris Campbell351365950070.6112288.25640.59%0.271.186722LACRB,QB,TE30082201131181501030141301125099101029119908540111201106011080966137106620689079106060110014130114101171011710117101171
12Austin EkelerJustin HerbertChase McLaughlinGerald EverettAlec Pierce351375850070.23118.6287.64740.65%0.271.200512LACRB,QB,TE3014340130919550118014980129401178011941244097201289012840127601128145907750857095707450126308700131501013580135801358
13Justin HerbertAustin EkelerChase McLaughlinGerald EverettParris Campbell74165950072.185120.49588.25640.59%0.271.213193LACQB,RB,TE3008920122918910111314560122101096011221228092101212012060120301055140907260775087506750118914510123701276012760127601276
14Justin HerbertAustin EkelerChase McLaughlinGerald EverettAlec Pierce74175850071.805117.11587.64740.65%0.271.227435LACQB,RB,TE30146201352198001217152501334012230123412540100101331013260131701172148607890899099907870130209020135801014030140301403
15Austin EkelerJustin HerbertCameron DickerGerald EverettParris Campbell354665900069.8798.0986.86630.51%0.51.184237LACRB,QB,K,TE40013380173611296134801237017490168201605138301443017410170801727016061576010630125501276010260158516130178301862018620186201862
16Austin EkelerJustin HerbertCameron DickerGerald EverettAlec Pierce354675800069.4994.7186.25730.56%0.51.198103LACRB,QB,K,TE40157601909114601425013470192501883017621448016440192501880019020179716460117401456014760116901713013830196601020630206302063
17Justin HerbertAustin EkelerCameron DickerGerald EverettParris Campbell77465900071.44596.58586.86630.51%0.51.210932LACQB,RB,K,TE40014080182011372138301303018340177701681141501538018280179001811016961597011130135001370010790164116540186601957019570195701957
Worksheet
Cell Formulas
RangeFormula
Y2:Y17Y2=IF($AA$2="",COUNTIF(G2:K2,$Z$2),COUNTIF(G2:K2,$Z$2)*COUNTIF(G2:K2,$AA$2))
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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