+ Reply to Thread
Results 1 to 12 of 12

List manipulation, how to change the starting point in a list of set numbers

  1. #1
    Registered User
    Join Date
    04-11-2020
    Location
    preston, England
    MS-Off Ver
    10
    Posts
    2

    List manipulation, how to change the starting point in a list of set numbers

    Hello,

    Ive spent hours trying to look up formulas to help me change the start point of a set list of numbers. Using Roulette wheel as an example. 0,32,15,19,4..... would be placed 0,1,2,3,4,5 in a clockwise spin. So if 15 came in i would want to insert 15 and the list would reconfigure and start 15 as 0, 19 as 1, 4 as 3.....etc. 0 and 32 at the begining of the list would be moved to the bottom in the same order as the wheel, does that make sense? Essentially i am treating the last number coming in as home and looking for patterns in how many places from home the ball drops.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: List manipulation, how to change the starting point in a list of set numbers

    Which wheel type are we talking about?

    Single-zero wheel
    0-32-15-19-4-21-2-25-17-34-6-27-13-36-11-30-8-23-10-5-24-16-33-1-20-14-31-9-22-18-29-7-28-12-35-3-26

    Double-zero wheel
    0-28-9-26-30-11-7-20-32-17-5-22-34-15-3-24-36-13-1-00-27-10-25-29-12-8-19-31-18-6-21-33-16-4-23-35-14-2

    Triple-zero wheel
    0-000-00-32-15-19-4-21-2-25-17-34-6-27-13-36-11-30-8-23-10-5-24-16-33-1-20-14-31-9-22-18-29-7-28-12-35-3-26

    Whichever wheel type you are talking about.

    Lets assume single zero
    Surely if you create an array listing the sequence twice

    0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26, 0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26

    If your last number is 15

    Use RandBetween to return a number between 0 and 36

    Lets Assume 9

    Use Match to find 15 in your array

    =MATCH(15,{0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26,0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26},0)

    =3

    use Choose to select your new number which will be 3+9 from the start = 27

    =CHOOSE(13,0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26, 0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26)

    Returns 27
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: List manipulation, how to change the starting point in a list of set numbers

    @Harri05,

    I think you are making this too hard for yourself. If you are picking the number from the list using a random index number (which without being able to see your code, that is what I assume you are doing), why do you think you have to change the order of the list? A random index number is a random index number... the order of the list it is picking from is immaterial. Just leave the list as is and let the random number generate pick a number from it randomly.
    Last edited by Rick Rothstein; 04-11-2020 at 03:25 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: List manipulation, how to change the starting point in a list of set numbers

    I assume what you mean is: a number comes up, you pass that to a function to re-arrange the list of numbers now beginning that came up on the last "spin". If so, this might do what you want:
    Please Login or Register  to view this content.
    That's assuming your number list is in column "A", starting in A1. Also, although it's a "numbers" list, they need to be entered as text to avoid "00" showing as "0" etc.

    Assuming the number 15 comes up... you call the function with revolve_list("15") and, hey presto, your list has spun itself round.

    See attached.
    Attached Files Attached Files
    Never stop learning!
    <--- please consider *-ing !

  5. #5
    Registered User
    Join Date
    04-11-2020
    Location
    preston, England
    MS-Off Ver
    10
    Posts
    2

    Re: List manipulation, how to change the starting point in a list of set numbers

    Harrisonland,

    I think you may have it!!!!! i cant call the function though for some reason, you'll have to forgive me i'm a bit of a novice. Any further help here would be appricated. i'm just constantly streaming you tube.

  6. #6
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: List manipulation, how to change the starting point in a list of set numbers

    I've attached another copy that demonstrates. Have a look at the code that the button calls (the assigned macro) so you can see what's going on.
    Please Login or Register  to view this content.
    Tim
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: List manipulation, how to change the starting point in a list of set numbers

    @harrisonland,

    Your code does not work for me because I am using XL2010 and that version does not have the TEXTJOIN function that you used in your Evaluate function call. I think the OP is also using XL2010 (it is hard to know for sure what the version 10 he shows means), so I am thinking your code may not work for him either.

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: List manipulation, how to change the starting point in a list of set numbers

    @Harri05,

    Is your ultimate goal to find out how many place away two numbers are (always traveling in the same direction around the wheel)? If so, I think this function will work for you. It takes two arguments, the first argument is the new number and the second argument is the last (previous) number, and the function returns how many positions away (around the wheel) the new number is from the last number. So if you want to test against a fixed previous number, vary the first argument and leave the second argument at that fixed previous number. Anyway, here is the code for you to test out...
    Please Login or Register  to view this content.
    Note that the wheel numbers are embedded within the function (dash delimited within the Split function call) so change them to match the actual number sequence you want to test with.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: List manipulation, how to change the starting point in a list of set numbers

    You can use a formula as well
    put the start number in b2,c2 etc
    =INDEX($A$2:$A$38,IFERROR(1/(1/MOD(ROW(A1)+MATCH(B$1,$A$2:$A$38,0),37)),37))

    @harrisonland
    Along with the comments by Rick, try entering 1 as the start number
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: List manipulation, how to change the starting point in a list of set numbers

    Quote Originally Posted by Fluff13 View Post
    You can use a formula as well
    I wasn't sure if the OP just wanted the count difference or if he actually wanted to see the "revolved" "wheel" numbers. I assumed he wanted the count difference only; hence, the function that I posted.

    Another way to see the revolved wheel numbers is to use a macro to "revolve" them in place. Lets say the "wheel" numbers are in cells A1 through A38. Since I am assuming a roulette wheel, those cells must be formatted as Text so that "00" does not become "0" due to Excel's "helpfulness". This code will revolve them in place by placing the new number entered into the InputBox at cell A1...
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 04-12-2020 at 11:05 AM.

  11. #11
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: List manipulation, how to change the starting point in a list of set numbers

    Quote Originally Posted by Fluff13 View Post
    Along with the comments by Rick, try entering 1 as the start number
    Ooops. That's no good! Cludge:
    Please Login or Register  to view this content.
    Last edited by harrisonland; 04-12-2020 at 11:18 AM.

  12. #12
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: List manipulation, how to change the starting point in a list of set numbers

    Doesn't resolve the Exel 2010 issue, though. I *think* this does
    Please Login or Register  to view this content.
    However, I feel I'm clutching at straws... getting my concept to work when others' is more elegant! Thanks for pointing out my errors!

    Tim
    Last edited by harrisonland; 04-12-2020 at 11:39 AM.

+ 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. Replies: 3
    Last Post: 04-12-2018, 01:23 PM
  2. Replies: 3
    Last Post: 02-23-2017, 02:06 PM
  3. Replies: 2
    Last Post: 02-15-2017, 02:40 PM
  4. [SOLVED] sum numbers over several sheets with varing starting / ending point
    By hänschendampf in forum Excel General
    Replies: 13
    Last Post: 03-30-2016, 11:26 AM
  5. Data Validation - Can I change the starting point?
    By FSUdawg85 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-28-2013, 09:54 AM
  6. selecting starting point in drop down list
    By -Brian-H- in forum Excel General
    Replies: 0
    Last Post: 08-29-2006, 12:34 PM
  7. Replies: 3
    Last Post: 08-19-2005, 09:05 AM

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