Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default set of numbers, i.e. [1..48]

Is it possible to work with sets of integers in Excel?
=set(1..48)
or will I end up using booleans in a column to signify presence and absence?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default set of numbers, i.e. [1..48]

Perhaps you can explain what you're trying to achieve?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Drew K" <Drew wrote in message ...
| Is it possible to work with sets of integers in Excel?
| =set(1..48)
| or will I end up using booleans in a column to signify presence and absence?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default set of numbers, i.e. [1..48]

Thanks Niek,

I wrote a program so long ago in Pascal that handles placing students at my
school at random dinner tables for our formal meals. I want to pass the
assignment responsibility off to a non-programmer, and feel excel might be
strong enough to do it without learning any visual basic.

To simplify: I've got four sets of 80 students. I randomly pick one kid in
the set and place him at table 1, and remove him from the set. I repeat,
going around the room until that set is empty. Then I start on the second
set, doing the same thing.

It works very well, and the only shortcoming is that a student will randomly
end up back at the same table later on, or with many of the same students
later on. The ideal would be to store a seating history, and if a student
gets placed poorly then he'd go back into the set and another one selected
for placement.

I hope this makes some sense, and thanks to anyone who has read this far!

"Niek Otten" wrote:

Perhaps you can explain what you're trying to achieve?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Drew K" <Drew wrote in message ...
| Is it possible to work with sets of integers in Excel?
| =set(1..48)
| or will I end up using booleans in a column to signify presence and absence?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27,285
Default set of numbers, i.e. [1..48]

=index({1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 ,35,36,37,38,39,40,41,42,43,44,45,46,47,48},1,Trun c(rand()*48+1))

is an example of randomly selecting a number from a set of 48 numbers

on each calculate, a new number is selected at random (there may be
repeats). This is just an example to illustrate a set of numbers. The
functionality is not the point.

--
Regards,
Tom Ogilvy

"Drew K" <Drew wrote in message
...
Is it possible to work with sets of integers in Excel?
=set(1..48)
or will I end up using booleans in a column to signify presence and
absence?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default set of numbers, i.e. [1..48]

=INDEX(ROW(1:48),INT(RAND()*48+1))

Or, to make it robust against row insertions:

=INDEX(ROW(INDIRECT("1:48")),INT(RAND()*48+1))

Biff

"Tom Ogilvy" wrote in message
...
=index({1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 ,35,36,37,38,39,40,41,42,43,44,45,46,47,48},1,Trun c(rand()*48+1))

is an example of randomly selecting a number from a set of 48 numbers

on each calculate, a new number is selected at random (there may be
repeats). This is just an example to illustrate a set of numbers. The
functionality is not the point.

--
Regards,
Tom Ogilvy

"Drew K" <Drew wrote in message
...
Is it possible to work with sets of integers in Excel?
=set(1..48)
or will I end up using booleans in a column to signify presence and
absence?







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27,285
Default set of numbers, i.e. [1..48]

Your assuming his numbers are sequentially numbered - I didn't make that
assumption - just used it as an example.

--
Regards,
Tom Ogilvy


"Biff" wrote in message
...
=INDEX(ROW(1:48),INT(RAND()*48+1))

Or, to make it robust against row insertions:

=INDEX(ROW(INDIRECT("1:48")),INT(RAND()*48+1))

Biff



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching numbers in Worksheet? Johncobb45 Excel Worksheet Functions 3 July 28th 06 07:07 PM
conditional formatting Lofty Excel Worksheet Functions 7 July 10th 06 09:06 PM
How to generate sets of random numbers without having duplicates William Excel Worksheet Functions 1 June 6th 06 05:30 AM
Why are 1/2 my numbers imported as text and the rest as numbers? KBear Excel Discussion (Misc queries) 2 April 21st 06 01:40 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM


All times are GMT +1. The time now is 07:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"