cut off data at item #20

btardo01

Board Regular
Joined
Oct 6, 2009
Messages
168
Office Version
  1. 2016
Platform
  1. Windows
I am using the following formula, which is returning a #spill error. The formula is supposed to be taking the top 20 items; however, the problem is that item 20 and item 21 are the exact same value. I need to keep my total row were it is so I need to somehow just stop at item 20 even it the value is the same as item 21. Can I somehow amend the formula so that if any items past item 20 has the same value as item 20, it just picks the first one it get to?

=SORT(FILTER(FILTER(StaffData!B:Y,StaffData!M:M>=LARGE(StaffData!M:M,MIN(20,COUNTIF(StaffData!M:M,">0")))),{1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0}),2,-1)
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I assume you're not running Excel 2016 any more?

Is this what you need?

=TAKE(SORT(CHOOSECOLS(FILTER(StaffData!B:M,StaffData!M:M>0),1,12),2,-1),20)
 
Upvote 0
yes, that seems to have worked. Thank you very much.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,689
Members
449,117
Latest member
Aaagu

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