formula to identify cells in top %

JV0710

Active Member
Joined
Oct 26, 2006
Messages
429
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Good day everyone

I apologise that I may have asked this question before, But I recently lost all my laptop and all backups ( and attemps to search for my previous posts show only 6 previous posts )

In the example shown:
In coulmn E, I am looking for a formula that will return the "% Contr", from column F, if it falls into the top 60% ( Or whatever % I put into cell E2 & E3 ) - Another variation would be to return a message ( Like : Good, Bad etc - If I wanted to marked the numbers that make up the bottom 25% for example)

Thanks for your help
test top80 perc.xls
ABCDE
1%Contrmakingupthe
2Top
3ProductSales%Grwth%Contr60%
4Category113,5580.00%0.00%
5Category21,1830.00%0.00%
6Category3129,595,201-16.49%30.48%30.48%
7Category4166,860279.58%0.04%
8Category514,604,47536.21%3.44%
9Category6276,5462587.92%0.07%
10Category71,295-85.91%0.00%
11Category8122,834149.71%0.03%
12Category9125,237,206-28.83%29.46%29.46%
13Category107,984,81131.55%1.88%
14Category114,977,4963.42%1.17%
15Category127,755,97346.23%1.82%
16Category1320,4970.00%0.00%
17Category1455,083,86611.21%12.96%
18Category156,295,73331.29%1.48%
19Category1654,712,4499.44%12.87%
20Category176,524,887-8.16%1.53%
21Category181,730,47411.08%0.41%
22Category1938,783-18.43%0.01%
23Category200-100.00%0.00%
24Category213,838,3676031.77%0.90%
25Category226,181,686-32.27%1.45%
26Total425,164,180-11.61%100.00%
27
28IncoulmnE,Iamlookingforaformulathatwillreturnthe"%Contr",fromcolumnF,ifitfallsintothetop60%(Orwhatever%IputintocellE2&E3)-Anothervariationwouldbetoreturnamessage(Like:Good,Badetc-IfIwantedtomarkedthenumbersthatmakeupthebottom25%forexample)
29
30
31
32
33
Sheet3
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I'm not a formula whizz like some of these guys so the only way I can think to do it would be to add an additional column that pulls rank - say column F

F4 = RANK($D$4,$D$4:$D$25,0)

This would then show the relative position of that % in the range.

Then in E you could use a sumif type formula utilising the RANK position

E4 = $D4*(SUMIF($F$4:$F$25,"<"&$F4,$D$4:$D$25)<0.6)

What this is basically doing is calculating the accumulated percentage of the values preceeding the current rank and if less than 60% it multiplies the current percentage being reviewed by 1 thus returning that percentage in E -- if not it shows as 0.

You could obviously adjust / extend to show blank if that's your preference, else you could format col E accordingly such that 0 shows as blank.
 
Upvote 0
Thank you LAWS10

That works . . .

Ideally I do not want to use other columns - but this will do

Thanks again

JVN
 
Upvote 0
Laws10

Okay . . .

I got it to work without using an extra column by using the principle of your formula and modifying it to this:

In cell E4 ( copied down ), the formula is:
=IF(D4*(SUMIF(D$4:D$25,">"&D4,D$4:D$25)<$E$3)=0,"",D4*(SUMIF(D$4:D$25,">"&D4,D$4:D$25)<$E$3))

This does exactly what your formula was doing and hides the Zero values - in one column

But now I have a another problem:
the values that it is identifying as being in the top 60% are: D6 (30.48%) , D12 (29.46%) and D17 ( 12.96%).

That adds up to 72.9% - It is too high -

It should just bring back 30.48% and 29.46%, which is 59.94%

Can anyone help me do this ?
 
Upvote 0
Well, you could try this "mouthful" until somebody comes up with the "easy way".

Excel Workbook
DE
2Top
3%*Contr60%
40.00% 
50.00%
630.48%30.48%
70.04%
83.44%
90.07%
100.00%
110.03%
1229.46%29.46%
131.88%
141.17%
151.82%
160.00%
1712.96%
181.48%
1912.87%
201.53%
210.41%
220.01%
230.00%
240.90%
251.45%
26100.00%
Top %
 
Upvote 0
Thanks Peter

This gets the result closer to the 60%.

If I change the % to 70% though, I get the same result and it does add the 12.96 % to get closer to the 70%.

I guess what i am looking for is to get within a certain acceptable percentage to the target % - let's say 10% either way. . .( If that makes sense ).

I like your formula though . . . I am going to spend the next few hours getting my head around it and playing out different scenarios with it.

Thanks Once again

JVN

LASW10 - I apologise for spelling your id wrong in my replies
 
Upvote 0
But now I have a another problem:
the values that it is identifying as being in the top 60% are: D6 (30.48%) , D12 (29.46%) and D17 ( 12.96%).

That adds up to 72.9% - It is too high -
I thought this earlier statement meant that you did not want to exceed the given %. Are you saying that the selected items can exceed the % in E3 - you just want the total that is closest to E3 whether it is above or below?

If so, what would you want to happen if the E3 value is 70% and the top 3 numbers added to 68% and the top 4 numbers added to 72%?
 
Upvote 0
Thanks for reply Peter

Now you have me stumped . . . I did not think about that

Okay, so After some deliberation, the decision is to have the selected numbers total up to the closest number to what is in e3 ( whether above or below ), and if you have the situation with the where e3 is 70% and the one set of numbers add to 68% and another set adds up to 72%, then show the higher of the two i.e. the set that adds to 72%

JVN
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,212
Members
448,874
Latest member
b1step2far

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