+ Reply to Thread
Results 1 to 16 of 16

Randomly assign codes to cells

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Randomly assign codes to cells

    Bit of a complicated one and I have no real idea if it can even be done. I have a spreadsheet of students (213 of them) and the classes they take during different periods (i.e. column one is the list of students, then the columns afterwards are Monday P1, Monday P2 and so on). There is a two week timetable too.

    Some periods don't have any data in, because they have a free period, but I need to randomly assign two specific study periods (using an ICT suite) per student.

    However, there can only be a certain number of kids in the study period due to the lack of computers! I essentially want to allocate two study sessions per row (i.e. per student), but without having 86 students attending one study session (for example), and only four in the second. I fear that there are too many variables and I'll have to do it the old fashioned slow way.

    Any ideas how it could be done?

    I did try the following:
    Please Login or Register  to view this content.
    but this doesn't work (my first attempt at a macro!). I've attached the file as I'm not sure if I've made sense!
    Attached Files Attached Files
    Last edited by Gemsie; 09-27-2013 at 05:38 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    What is the maximum allowable number of students per study session?
    What is an ICT suite?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Hi, thanks for your reply. The maximum number is approximately 20. An ICT suite is a fancy name for a computer room!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,,

    I must admit i find this confusing. Mostly because I don't understand the abbreviations used. The CIT seems to used only on Mondays during period 6. The entries in these columns like "12C/El1", "12C/So1", "13D/Dr1", and "13D/Ph1" appear to the grade, group, and class. Does that mean the student should studying these subjects during the free period in the CIT?

  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Quote Originally Posted by Leith Ross View Post
    Hello Gemsie,,

    I must admit i find this confusing. Mostly because I don't understand the abbreviations used. The CIT seems to used only on Mondays during period 6. The entries in these columns like "12C/El1", "12C/So1", "13D/Dr1", and "13D/Ph1" appear to the grade, group, and class. Does that mean the student should studying these subjects during the free period in the CIT?
    All the coding is just the different classes (Physics, History, etc). The spreadsheet shows the timetable for each student over a two week period. The ICT suite is a completely separate room that is not used for lessons and is not on the timetable (yet!). It's just a student study area with limited seating/computers.

    Each student is required to have two sessions in there per two week timetable. The rest of their blanks is just "self study" or as many do, time to sit in the common room! However, I've been finding it difficult to find a code that will assign two periods of ICT per student.

    Does this make sense? Do you think it's possible, or is it far too complicated?

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Randomly assign codes to cells

    Hi guys,

    Why not assign A,B,C,...Etc, to all those fancy Codes, for ease of following the logic, and then change it back again?
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    It would help me to see an example of the output. Just a single student example would do.

  8. #8
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Quote Originally Posted by Leith Ross View Post
    Hello Gemsie,

    It would help me to see an example of the output. Just a single student example would do.
    I'm embarrassed to say that I don't know what you mean

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    We're a fine pair. Can you show me what a 2 week period for a single student would look like with the ICT periods added in?

  10. #10
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    New example timetable.xlsx

    :D Ahhh, I see.

    Okay, the one I've attached has been done by hand, showing three students. I've entered two ICT sessions into their timetable. This was really easy, because there was only three of them. I started doing this with the 214 I have, but then got myself muddled and having problems with loads of students being marked down for ICT in the same period.

    I just wondered if I could make a macro that would randomly assign the code ICT to two blanks per row, but with only a maximum of say, 15-20 per column. Even better would be the code being assigned once per week A and once per week B!

    EDIT: I also want to say thank you for taking the time to look at this. It really is very kind of you.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    Okay, the one I've attached has been done by hand, showing three students. I've entered two ICT sessions into their timetable.
    If you attached an example workbook to your last post, it failed to attach.

  12. #12
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Really? I can open it on mine. Odd.

    Try again....New example timetable.xlsx

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    Now they both show up. Sometimes there is a lag in the forum updating the posts. Thanks for reposting it.

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Randomly assign codes to cells

    Hello Gemsie,

    It seems to me this would need to rotate evenly among the students. that is each student would be assigned to ICT once per week. The ones don't assigned in week 1 would be given priority in week 2. Does that make sense?

  15. #15
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Yep, so long as they all have two timetabled sessions, it doesn't really matter when they are.

  16. #16
    Registered User
    Join Date
    05-10-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Randomly assign codes to cells

    Does anyone know a) if this can actually be done to save me wasting hours on it...I'm supposed to have done it by Monday morning!

    and b) why my code isn't working:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Use Excel to randomly assign teams to sports competitions
    By Waldo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2013, 02:10 AM
  2. Randomly assign a value to rows
    By covegolfer in forum Excel General
    Replies: 3
    Last Post: 06-13-2011, 12:29 PM
  3. Randomly (and evenly) assign colors to cells
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2010, 05:22 PM
  4. How to assign value using a Char Codes?
    By CRayF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2005, 07:05 PM
  5. How do I randomly assign values in a grid?
    By Excel question in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2005, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1