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
For that amount, I very much doubt you will be able to do it with a formula.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
For that amount, I very much doubt you will be able to do it with a formula.
crud. what other options are there? what if I combine the total for each name? as in the example, the first individual has numerous lines, that could be combined into a single line with total amount. Kendra is in A2, A3, A4 with different amounts for them in B2, B3, B4. Something that takes a unique name and adds all of the numbers together. I could then use the formula you put together.
For that amount, I very much doubt you will be able to do it with a formula.
 
Upvote 0
Unfortunately with the layout in post#3 I don't know how to get the totals for each person.
 
Upvote 0
Unfortunately with the layout in post#3 I don't know how to get the totals for each person.
not sure which one is layout 3, but I am reattaching the current layout, does not have merged cells
 

Attachments

  • lottery figure.jpg
    lottery figure.jpg
    215.8 KB · Views: 6
Upvote 0
For that layout you can use the formula I suggested, but if you are going much beyond 1000 cells you could end up with a #value error.
 
Upvote 0
Another option that will cater for more rows
+Fluff 1.xlsm
ABCD
1
2John2John
3Mary1John
4Peter5Mary
5Sue7Peter
6Peter
7Peter
8Peter
9Peter
10Sue
11Sue
12Sue
13Sue
14Sue
15Sue
16Sue
17
Sheet3
Cell Formulas
RangeFormula
D2:D16D2=INDEX(A2:A5,FILTERXML("<k><m>"&MID(CONCAT(REPT("</m><m>"&ROW(B2:B5)-ROW(B2)+1,B2:B5)),8,33000)&"</m></k>","//m"))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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