Autofilter Top 10

richardjshaffer

Board Regular
Joined
Oct 9, 2008
Messages
84
Hi,

I have a query I just can't figure out how to solve.

We have a list of stores, some are regular stores and some are outlets (1 column shows if it's regular or outlet).

We need to show the top 10 using the autofilter top 10 option - it works fine for all stores - but we want to show the top 10 regular stores.

Using the top 10 filter and the stores column filter too to exclude the regular stores, we don't get the top 10 regular stores which we want, it only shows eg 8 regular stores because 2 outlet stores are hidden as they are in the top 10 filter.

Hope this is clear, any ideas? I don't really want to copy all the regular stores somewhere else to do the top 10 on as it's a complex spreadsheet already.

many thanks
Richard
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi, Richard.

It sounds like you have an identifier either 'regular store' or 'outlet'. Just combine two top 10 datasets. So, using a query table instead of the autofilter the SQL would be something like below. Modify for your headers.

HTH, Fazza

Code:
SELECT TOP 10 store, type, value
FROM source
WHERE type='regular store'
ORDER BY value DESC
UNION ALL
SELECT TOP 10 store, type, value
FROM source
WHERE type='outlet'
ORDER BY value DESC
 
Upvote 0
thanks for your help, though we don't use databases yet.

i was hoping there might be an excel solution, but I'm not sure there is.
 
Upvote 0
Hi, Richard. It is an Excel solution. I didn't spell it out in this post but have in many others. Or googling for examples and help on 'query tables' should find more info. Cheers, Fazza
 
Upvote 0

Forum statistics

Threads
1,202,904
Messages
6,052,464
Members
444,584
Latest member
gsupike

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