banding by value

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,056
Office Version
  1. 365
Platform
  1. Windows
I need a formula to label entries by where they sit in some groups. I am working between the raw data and a pivot table which summarises the raw data. The pivot is summed by Supplier and sorted in descending order. against each entry in the pivot table, i wish to create a formula that will identify the band in which a particular supplier sits. Using a nested If statement, I have managed to get the first two spend bands in. The last is not so cooperative.

So, the bands are spend between $100k and $200k, spend greater than $200K up to the next group which is our Top 100 suppliers. The result of the formula will be a label against each of the pivot table entries of either Top100, 200, or 100. We are not looking below the $100k mark in this exercise.

the formula at present is:

IF(C10<$H$1,"",IF(AND(C10>$H$1,C10<$H$2),"100",IF(AND(C10>$H$2,C10<$H$3),"200",IF(C10>$H$3,"Top100",""))))

where:

Column c is the Total spend per supplier
H1 =100000
H2 = 200000
H3 = the cutoff $$value for our top100 (I used a hard coded number to see if my formula would work).

if C10 (first company's expenditure) is less than $100k, not interested
if C10 is between $100k and $200k, label is "100"
if C10 is between $200k and the lowest Top100 value, label is "200"
lastly, if C10 is greater than the Top100 cutoff, label is "Top100"

i can't seem to get Rank to work in the pivot itself. I get "1" returned against each row.

very confused at this point and would appreciate some help.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try:
Book3
CDEFGHIJ
1100000100
2200000200
3500000Top100
4
5
6
7
8
9
1090000 
11100000100
12150000100
13200000200
14250000200
15499999200
16500000Top100
17550000Top100
Sheet2
Cell Formulas
RangeFormula
D10:D17D10=XLOOKUP(C10:C17,H1:H3,I1:I3,"",-1)
Dynamic array formulas.
 
Upvote 0
Thanks. The trouble i am having is with the Top100. As you have above i set a number for the cutoff for Top100. I need this to be dynamic. I would like the formula to determine whether or not a supplier is one of the Top100 based on the level of expenditure.

An alternative method might be to add a ranking column to my pivot table and then label the Top100 and exclude the tail first, then band the rest. Ranking doesnt seem t work for me either.
 
Upvote 0
Try:
Book3
CDEFGHI
1100,000100
2200,000200
3475,794Top100
4
5
6
7
8
9
10638,004Top100
11844,797Top100
12811,113Top100
13661,407Top100
14529,286Top100
1571,855
1673,059
17992,668Top100
18537,429Top100
19546,651Top100
20469,239200
21241,296200
22220,767200
23366,707200
24218,324200
25430,164200
26406,118200
27502,085Top100
28968,964Top100
29888,695Top100
30106,833100
31451,892200
32286,630200
33435,051200
34579,912Top100
35460,363200
36488,668Top100
37842,682Top100
38873,010Top100
39928,661Top100
40200,416200
41964,787Top100
42386,740200
43756,164Top100
44679,091Top100
45310,369200
46785,657Top100
47682,724Top100
48476,556Top100
49898,147Top100
50439,403200
51774,533Top100
52876,348Top100
53110,499100
54163,078100
5516,606
56111,727100
57807,122Top100
58169,545100
59840,935Top100
6079,972
61763,353Top100
62985,593Top100
63359,209200
64175,021100
65261,526200
66932,608Top100
67394,868200
6886,325
6952,719
70589,689Top100
71475,794Top100
72796,304Top100
7396,991
74218,649200
75401,171200
76915,689Top100
77476,615Top100
78728,901Top100
793,351
80386,661200
81849,416Top100
82748,022Top100
83762,675Top100
84347,373200
85569,800Top100
86226,176200
8793,153
88989,243Top100
89774,862Top100
90577,599Top100
91338,366200
92552,117Top100
93395,162200
9411,910
95739,756Top100
96647,930Top100
97567,345Top100
98313,547200
99127,926100
100736,388Top100
101535,703Top100
102140,648100
103256,725200
104351,668200
105675,519Top100
106640,100Top100
107499,204Top100
108200,686200
109783,381Top100
110924,755Top100
111208,094200
112157,166100
113583,767Top100
114496,448Top100
115284,990200
116602,331Top100
117299,175200
118293,350200
119847,155Top100
120973,463Top100
121539,662Top100
122279,516200
123843,604Top100
124427,977200
125206,094200
126465,469200
127889,576Top100
12818,636
129513,377Top100
13018,673
131177,424100
132196,499100
133761,798Top100
134564,248Top100
135884,632Top100
136205,420200
137861,916Top100
138432,338200
139952,368Top100
140914,889Top100
141461,783200
142371,662200
143142,320100
144730,548Top100
145176,268100
146814,184Top100
147840,654Top100
148124,525100
149353,550200
150813,632Top100
151188,777100
152833,810Top100
153460,923200
15486,071
155540,704Top100
15684,789
1572,997
158519,292Top100
159711,552Top100
160653,318Top100
16145,859
162116,371100
163830,087Top100
164178,044100
165597,659Top100
166640,348Top100
16769,592
168443,921200
169583,125Top100
170200,140200
171730,483Top100
172325,196200
173550,416Top100
174237,686200
175178,431100
176364,384200
177858,704Top100
178766,211Top100
179140,903100
180664,925Top100
181129,393100
18290,931
183977,022Top100
184656,579Top100
18539,645
186375,363200
187215,320200
188870,505Top100
189888,209Top100
190346,219200
191338,571200
19271,023
193993,064Top100
194717,262Top100
195314,489200
196993,226Top100
197532,604Top100
198366,233200
199659,723Top100
200554,543Top100
201912,597Top100
202430,586200
203594,839Top100
204205,939200
205235,395200
206312,793200
207289,473200
208248,710200
209718,217Top100
Sheet2
Cell Formulas
RangeFormula
H3H3=LARGE(C10:C209,100)
D10:D209D10=XLOOKUP(C10:C209,H1:H3,I1:I3,"",-1)
Dynamic array formulas.
 
Upvote 0
thanks. hadn't thought of large. will give it a crack.
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,266
Members
452,902
Latest member
Knuddeluff

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