ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to generate a random list of weekDAYS between two dates? (https://www.excelbanter.com/excel-worksheet-functions/46587-how-generate-random-list-weekdays-between-two-dates.html)

Yanzel Muniz

How to generate a random list of weekDAYS between two dates?
 
I need to generate a random list of day, excluding saturday and sunday,
between two dates. This is for assigning items to be counted as part of a
cycle count. I can generate the random list which more or less distributes
the items between the two days but it includes saturdays and sundays. I need
the assignment without weekends.

Gary''s Student

First create a table of available dates. Enter the first date (say in A1)
and grab the lowerleft hand corner and drag it down as far as needed ( tell
the option to fill series). Next in B1 enter

=RAND()+(WEEKDAY(A1)=7)*10+(WEEKDAY(A1)=1)*10

and copy down. Notice that the B cells are "large" for weekend days. Just
sort by column B. Notice that the weekend days sink to the bottom.


Take as many days of the top of the list as you want to sample.


--
Gary''s Student


"Yanzel Muniz" wrote:

I need to generate a random list of day, excluding saturday and sunday,
between two dates. This is for assigning items to be counted as part of a
cycle count. I can generate the random list which more or less distributes
the items between the two days but it includes saturdays and sundays. I need
the assignment without weekends.



All times are GMT +1. The time now is 01:43 AM.

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