Quartiles by Year

hales231

New Member
Joined
Dec 23, 2011
Messages
15
I have a large dataset (almost 300K rows) with multiple years of information (2003-2016). I'm trying to assign size into a Small, Medium, and Large category by year. My first attempt was to determine the quartiles then manually assign the size to a category but I'm sure there is a more efficient way of doing this. Thank you for your help.

[TABLE="width: 158"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Year[/TD]
[TD]Size[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]136[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]146[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]107[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]139[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]152[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]102[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]147[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]106[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]119[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]152[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]107[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]116[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]129[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]106[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]102[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]114[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]120[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]126[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]118[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]119[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]108[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]149[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]132[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]128[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]113[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hey hales,

Can you please show your expected results so we know what your end results should be? Thank you.

-C
 
Upvote 0
I think you need define range criteria first, for Small, Medium and Large and use it in PivotTable
 
Last edited:
Upvote 0
Sorry for the vague question. I need to assign a quartile to each size based on the total range of sizes for the year. Every year has a different range of sizes so using a set criteria doesn't work with this dataset. I've also included the quartile table for reference.

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Year[/TD]
[TD="class: xl65, width: 64"]Size[/TD]
[TD="class: xl65, width: 64"]Quartile[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]136[/TD]
[TD="class: xl65"]75[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]146[/TD]
[TD="class: xl65"]75[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]107[/TD]
[TD="class: xl65"]25[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]139[/TD]
[TD="class: xl65"]75[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]152[/TD]
[TD="class: xl65"]75[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]125[/TD]
[TD="class: xl65"]50[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]102[/TD]
[TD="class: xl65"]25[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]147[/TD]
[TD="class: xl65"]75[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]106[/TD]
[TD="class: xl65"]25[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]119[/TD]
[TD="class: xl65"]50[/TD]
[/TR]
[TR]
[TD="class: xl65"]2003[/TD]
[TD="class: xl65"]125[/TD]
[TD="class: xl65"]50[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 344"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Year[/TD]
[TD]25[/TD]
[TD]50[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]2003[/TD]
[TD]112[/TD]
[TD]120[/TD]
[TD]131[/TD]
[/TR]
[TR]
[TD]2004[/TD]
[TD]112[/TD]
[TD]118[/TD]
[TD]124[/TD]
[/TR]
[TR]
[TD]2005[/TD]
[TD]113[/TD]
[TD]121[/TD]
[TD]128[/TD]
[/TR]
[TR]
[TD]2006[/TD]
[TD]104[/TD]
[TD]111[/TD]
[TD]118[/TD]
[/TR]
[TR]
[TD]2007[/TD]
[TD]101[/TD]
[TD]105[/TD]
[TD]110[/TD]
[/TR]
[TR]
[TD]2008[/TD]
[TD]109[/TD]
[TD]116[/TD]
[TD]124[/TD]
[/TR]
[TR]
[TD]2009[/TD]
[TD]110[/TD]
[TD]117[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]2010[/TD]
[TD]110[/TD]
[TD]117[/TD]
[TD]124[/TD]
[/TR]
[TR]
[TD]2011[/TD]
[TD]105[/TD]
[TD]111[/TD]
[TD]117[/TD]
[/TR]
[TR]
[TD]2012[/TD]
[TD]109[/TD]
[TD]116[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]2013[/TD]
[TD]108[/TD]
[TD]115[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]2014[/TD]
[TD]102[/TD]
[TD]111[/TD]
[TD]122[/TD]
[/TR]
[TR]
[TD]2015[/TD]
[TD]103[/TD]
[TD]111[/TD]
[TD]121[/TD]
[/TR]
[TR]
[TD]2016[/TD]
[TD]100[/TD]
[TD]109[/TD]
[TD]118[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Try:
This is an array formula that must be entered with CTRL-SHIFT-ENTER.
Drag formula down and across as needed.
Excel Workbook
ABCDEFG
1YearSizeYear0.250.50.75
220031362003116136143
320031462004112119136
420031072005110118123
520031392006118130137
62003152
72003125
82003102
92004147
102004106
112004119
122004125
132004
142004152
152004107
162004116
172005129
182005106
192005102
202005114
212005120
222005126
232005118
242006119
252006108
262006149
272006143
282006132
292006128
302006135
312006113
Sheet
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
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