+ Reply to Thread
Results 1 to 5 of 5

Repeat list of names by number of ballots purchased

  1. #1
    Registered User
    Join Date
    12-19-2011
    Location
    Sudbury, ontario
    MS-Off Ver
    Excel 2007
    Posts
    6

    Repeat list of names by number of ballots purchased

    I have searched high and low, I am looking to repeat a list of names by the number of ballots each individual has purchased. I am doing a draw for work and do not want to repeat each name manually into separate cells. Is there a formula for this? Can the rept function have the data repeated into separate cells?
    Last edited by Laliberte78; 12-20-2011 at 10:07 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Repeat list of names by number of ballots purchased

    Let's say your list of tickets purchased is on Sheet1 with column A being the name and B being # of tickets.
    On Sheet2 in A1 Dragged or copied to the right and down
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Repeat list of names by number of ballots purchased

    Assuming your list of names is in A2:A5 and the number of tickets each purchased is in B2:B5, then in C2 add a helper column that cumulatively sums the number of tickets with:

    =SUM(B$2:B2)

    copied down

    then your final list is produced with formula:

    =IF(ROWS($E$2:$E2)>$C$5,"",INDEX($A$2:$A$5,MIN(IF(ROWS($E$2:$E2)<=$C$2:$C$5,ROW($C$2:$C$5)-ROW($C$2)+1))))

    confirmed with CTRL+SHIFT+ENTER not just ENTER, then copied down
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Repeat list of names by number of ballots purchased

    This version would work without a helper column.....

    in D2 and copied down

    =LOOKUP(ROWS(D$2:D2)-1,SUBTOTAL(9,OFFSET(B$1,,,ROW(B$1:B$5)-ROW(B$1)+1)),A$2:A$5)&""
    Audere est facere

  5. #5
    Registered User
    Join Date
    12-19-2011
    Location
    Sudbury, ontario
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Repeat list of names by number of ballots purchased

    Thank you! Worked like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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