Help needed translating number to rows for drawing

rlleblan1

New Member
Joined
Sep 18, 2018
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have an excel sheet with names and number of "tickets" they have earned. The goal is to use a random number generator to select multiple winners for a drawing. For this to work, I need a way of taking a large spreadsheet and creating a new row with the name of the individual based on the number of tickets. For example, Cell A2 has the name john and cell B2 has "60", which is the number of tickets he earned. In cell A3 is the name Mary and Cell B3 has "20".

The output, on a new worksheet, would generate 60 rows with the name John in it followed by 20 rows with the name Jane.

Attached an example. Thanks in advance for your help and insight.
 

Attachments

  • lottery example.png
    lottery example.png
    74.9 KB · Views: 9

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
updated information. Uploading new image of actual report. little more complicated
 

Attachments

  • lottery example.jpg
    lottery example.jpg
    180.1 KB · Views: 13
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
365. I also updated my account details as suggested.
 
Upvote 0
It can be done with the layou you 1st showed, but not the 2nd layout. You should avoid using merged cells, as the are an abomination & always cause problems.
 
Upvote 0
It can be done with the layou you 1st showed, but not the 2nd layout. You should avoid using merged cells, as the are an abomination & always cause problems.
afraid that was the case.
 
Upvote 0
With the 1st layout you could do it like
+Fluff 1.xlsm
ABCD
1
2John2John
3Mary1John
4Peter5Mary
5Sue7Peter
6Peter
7Peter
8Peter
9Peter
10Sue
11Sue
12Sue
13Sue
14Sue
15Sue
16Sue
17
Lists
Cell Formulas
RangeFormula
D2:D16D2=FILTERXML("<k><m>"&MID(CONCAT(REPT("</m><m>"&A2:A5,B2:B5)),8,33000)&"</m></k>","//m")
Dynamic array formulas.
 
Upvote 0
Solution
added image of data without combined fields.
 

Attachments

  • lottery figure.jpg
    lottery figure.jpg
    215.8 KB · Views: 8
Upvote 0
In that case see post#7 ;)
 
Upvote 0
In that case see post#7 ;)
it works when I put in the field! how do I account for an infinitie number of names in row "A" resulting in who knows how many rows based on ticket amount.. The current sheet has 583 rows and a total of almost 1000 tickets.
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top