ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Selecting a subset of items from a list (https://www.excelbanter.com/excel-worksheet-functions/102281-selecting-subset-items-list.html)

Steve

Selecting a subset of items from a list
 
I'm trying to write a function that will allow me to select a fairly
even distribution of data from a variable sized list.

I have 2 sheets, 1 of raw data, and one with presentation data. The raw
data one has say 31 entries on it, one for each day, the presentation
one has a fixed 10 cells of data. I need something that can start at
cell 1 on the raw sheet, and work through as evenly as possible to make
sure that the 10th entry on the presentation is the last entry on the
raw sheet.

The raw sheet can then change and have 62 entries, or 25 or whatever
the end user defines as the data range, but the presentation sheet will
always have 10.

The function is doing a bit more than that, but that's where the
problem lies. I have come up, so far, with the following:

=IF(ISBLANK(Trending_Data!B3),"",IF(COUNT(Source!$ E$2:$E$71)<=10,Source!E3,IF(H16+(ROUNDUP((COUNT(So urce!$E$2:$E$71))/10,0))=Source!$H$7+0,Source!$H$7,H16+(ROUNDUP((CO UNT(Source!$E$2:$E$71))/10,0)))))

The bit I'm having trouble with is the

ROUNDUP((COUNT(Source!$E$2:$E$71))/10,0)

I've tried ROUND too, but one comes up with too few results, the other
too many if the number isn't divisible directly by 10.

Can anyone give me some ideas?

Thanks,

Steve



All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com