Ranking a large a mount of data - want dupes included

Laurence83

New Member
Joined
Jun 1, 2016
Messages
19
Hi,

I've got a spreadsheet which has over 9,000 hotels on it & i use Sumifs and Countifs to work count-up the number of bookings and bed nights at each property. I've got to circulate this report and as you can imagine, looking through 9,000 properties isn't very interesting! So what i do is narrow it down to the top 50 most improved and the bottom 25 worst performers (compared to their performance over the same period last year.

I thought i'd cracked it by using this formula to find the largest number =LARGE('Property Stats'!Q$4:Q$9631,A138) & then the following formula in array {=MAX(IF('Property Stats'!Q$4:Q$9631<F138,'Property Stats'!Q$4:Q$9631))} to get the next 49. I'd then use this formula to get the name of the hotel =INDEX('Property Stats'!B$4:B$9631,MATCH($F138,'Property Stats'!$Q$4:$Q$9631,0),0). And then vlookups off the hotel name to get any other data i wanted.

But..... I've just found out (after thinking this worked fine last quarter) that the array formula is missing out some properties, because if for example the 10th ranked property has a value of 100 and the 11th ranked property also has a value of 100 it'll only pull through the 10th ranked property and then move on to the next unique value.

Has anyone come across a similar problem or has any suggestions?

If any of this ins't clear please let me know (this is my first time posting here - but I've used this forum a lot to help me out)

Thanks

Laurence
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Without knowing the layout of your dataset, you could have a column with the formula =RANK.EQ(cell,data_range)
If you work out the growth and then rank the growth of each individual hotel against the rest then any equal numbers (e.g. 5%) would be ranked equally.
Then just sort by the rank and you'll have your top 50.
 
Upvote 0
Welcome to Mr Excel

See if this example helps
Data in columns A:B
Objective --> list the Top5 Scores and Hotels


A
B
C
D
E
F
G
1
Hotel​
Score​
5th Largest​
Count​
Top Scores​
Hotel List​
2
Hotel1​
20​
20​
6​
30​
Hotel3​
3
Hotel2​
10​
26​
Hotel10​
4
Hotel3​
30​
22​
Hotel4​
5
Hotel4​
22​
22​
Hotel8​
6
Hotel5​
16​
20​
Hotel1​
7
Hotel6​
19​
20​
Hotel7​
8
Hotel7​
20​
9
Hotel8​
22​
10
Hotel9​
18​
11
Hotel10​
26​

<tbody>
</tbody>


Formula in D2
=LARGE(B2:B11,5)

Formula in E2
=COUNTIF(B:B,">="&D2)
as you can see there are duplicates scores and so more than 5 hotels with scores>= 5th largest

Formula in F2 copied down
=IF(ROWS(F$2:F2)>$E$2,"",LARGE($B$2:$B$11,ROWS(F$2:F2)))
observe the duplicates scores

Array formula in G2 copied down
=IF(F2="","",INDEX($A:$A,SMALL(IF($B$2:$B$11=F2,ROW($A$2:$A$11)),COUNTIF(F$2:F2,F2))))
confirmed with Ctrl+Shift+Enter

Hope this helps

M.
 
Upvote 0
thanks for the replies guys, I've been diverted away so not had a chances to fully test, but the rankings method by Marcelo works a treat, i'm just struggling with the Array formula to match up the hotel names - i'm sure it's something I've done, so will revisit it once time permits.
 
Upvote 0
Array formulas must be confirmed with Ctrl+Shift+Enter simultaneously.
If you are not familiar with array formulas take a look at
Array Formulas

M.
 
Upvote 0
thanks Marcelo, yes i have used array before (i was using one with this data), but i imagine it's just a column out or something simple - once i can get back to the sheet i'll revisit it and contact if i'm still having issues, thanks again.
 
Upvote 0
Hi,

I've been able to go back to this task this morning & i'm having an issue with the indexing, for some reason, that i can't fathom the indexing isn't working https://drive.google.com/file/d/0B-CeH_iteI5gdjBPeEtsSFBqYTQ/view?usp=sharing (this is a copy saved with data removed to protect annonymity). It's column b that i'm having a problem with, the formula, as you'll see is just taking the hotels in the order they are sorted, rather than referencing the variance (column I in property stats and column face on the face), (you'll see if you sort the data differently in the product stats, the face data changes).

Any assistance that can be provided will be greatly received, if any more info is needed please let me know.

Thanks
 
Upvote 0
You are using a wrong formula - observe carefully the array formula in G2, post #3

Try
=IF(F4="","",INDEX('Property Stats'!$B:$B,SMALL(IF('Property Stats'!$I$4:$I$9631=F4,ROW('Property Stats'!$B$4:$B$9631)),COUNTIF(F$4:F4,F4))))

Ctrl+Shift+Enter

M
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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