So you want an algorithm which returns a random number N between 1 and the total number of tickets (inclusive), and then tells you who holds the Nth ticket in the dataset? You could generate a number for each name which is the sum total number of tickets for themselves plus everyone else before them in the list, and then find the name corresponding to the maximum individual-total number which was still smaller than N. Example: You have four names: Alice, Bob, Charlie, and Dani - I'm going to assume you put these in Column A. They have 8,2,5, and 3 tickets respectively (for a sum total of 18 tickets). I'm going to assume these are in Column B, and their totals are in column C. Their matrix looks like this: Column A | Column B | Column C | Alice | 8 | 8 | Bob | 2 | 10 | Charlie | 5 | 15 | Dani | 3 | 18 (You can fill column C with "=SUM(1:INDIRECT("rc[-1]",0))" if you like; that'll populate it.) The random roll from 1-18 comes up with "11". Let's see how that plays out: In D1, put: =INDEX(A:A,MATCH(1,INDEX(C:C>=11,0),)) This will find the first value in the "C" column which is greater than or equal to 11, which is "15" in row 3. Then it will match that to the corresponding value in the "A" column and spit the correct name out: Charlie. Answer from Geminii27 on reddit.com
🌐
MrExcel
mrexcel.com › excel-tips › figure-out-lottery-probability
Figure Out Lottery Probability - Excel Tips - MrExcel Publishing
March 10, 2022 - If your state lottery game requires you to select 6 numbers out of 40, then the odds against you winning are 3.83 million to 1.
🌐
Excel Forum
excelforum.com › excel-formulas-and-functions › 1296503-probability-formula-based-on-a-numbers-since-last-drawn-number.html
Probability formula based on a numbers since last drawn number [SOLVED]
With that estimate, you could then say that numbers where the days since last draw is much less than the average are "cold" and numbers where the days since last draw is much longer than average are "hot". But (and this is important to remember) this tells you nothing about the probability of each number for the next draw, because the probability for each draw (assuming a fair lottery) is 1/45 or 2.22%.
Discussions

How to assign different probabilities for a lottery?

u/pangu2 - Your post was submitted successfully.

  • Once your problem is solved, reply to the answer(s) saying Solution Verified to close the thread.

  • Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post.

  • Include your Excel version and all other relevant information

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

More on reddit.com
🌐 r/excel
19
3
October 30, 2022
python - Calculate probability from an excel file - Stack Overflow
I have an excel file with x rows with random numbers (from 1 till 25). The total number of columns (numbers) can vary (15, 16, 17, 18, 19 or 20): I need python to tell me my probability of winning a More on stackoverflow.com
🌐 stackoverflow.com
Top 10 most frequent numbers in a Lotto excel spreadsheet
I have a rather large spreadsheet that displays every winning number set (out of 7) and I would like to display the most frequent 10 numbers? Not having much luck. Data is D3:K2648 which includes 7 numbers drawn for each draw plus a bonus number.… More on learn.microsoft.com
🌐 learn.microsoft.com
2
11
May 28, 2018
Lottery number frequency (example only) analysis via Excel - Stack Overflow
I want to analyse Lottery number (Other examples exist for similar problem) using Excel meeting the requirements below: want to find out the frequency of each number, ability to filter it for Wed,... More on stackoverflow.com
🌐 stackoverflow.com
🌐
ExcelDemy
exceldemy.com › home › algorithm in excel › how to create a lottery prediction algorithm in excel – easy steps
How to Create a Lottery Prediction Algorithm in Excel - Easy Steps - ExcelDemy
August 4, 2024 - Copy the Serial Number and Lottery Number columns by pressing Ctrl + C. Paste these columns. Click B5 under the Serial Number header. Right-click and choose Paste Special. Select Values and Source Formatting to paste the cells and keep the same format. This is the output. The Serial Number column keeps the most probable serial numbers. Press Delete to delete the second column.. Enter a formula to calculate the probability of the serial number.
🌐
Reddit
reddit.com › r/excel › how to assign different probabilities for a lottery?
r/excel on Reddit: How to assign different probabilities for a lottery?
October 30, 2022 -

Hello!

I have a dataset with names and a number. The number is more or less the number of tickets that they hold. So, for example, John 1, and Carl 5. John has 1 ticket, Carl has 5 tickets. Carl has a 5x higher probability of winning the lottery.

How do I run this lottery taking this uneven probability into account? I'm looking for some function or equation that takes already this dataset into account and does all the work.

Or alternatively, or at least it transforms this dataset in a way that duplicates each name based on the amount of tickets. So for instance, the new dataset would be: John, Carl, Carl, Carl, Carl, Carl. This way just selecting at random would still work and take into account the different likelihoods based on ticket number.

I'm using Google Docs. Also due to the way this works, ideally I'd be able to do this with decimals, so "0.5" tickets for example.

Thank you!

Top answer
1 of 4
4

So you want an algorithm which returns a random number N between 1 and the total number of tickets (inclusive), and then tells you who holds the Nth ticket in the dataset?

You could generate a number for each name which is the sum total number of tickets for themselves plus everyone else before them in the list, and then find the name corresponding to the maximum individual-total number which was still smaller than N.

Example: You have four names: Alice, Bob, Charlie, and Dani - I'm going to assume you put these in Column A. They have 8,2,5, and 3 tickets respectively (for a sum total of 18 tickets). I'm going to assume these are in Column B, and their totals are in column C. Their matrix looks like this:

Column A Column B Column C
Alice 8 8
Bob 2 10
Charlie 5 15
Dani 3 18

(You can fill column C with "=SUM($B$1:INDIRECT("rc[-1]",0))" if you like; that'll populate it.)

The random roll from 1-18 comes up with "11". Let's see how that plays out:

In D1, put:

=INDEX(A:A,MATCH(1,INDEX(C:C>=11,0),))

This will find the first value in the "C" column which is greater than or equal to 11, which is "15" in row 3. Then it will match that to the corresponding value in the "A" column and spit the correct name out: Charlie.

2 of 4
1

u/pangu2 - Your post was submitted successfully.

  • Once your problem is solved, reply to the answer(s) saying Solution Verified to close the thread.

  • Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post.

  • Include your Excel version and all other relevant information

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

🌐
Microsoft Community
techcommunity.microsoft.com › microsoft community hub › communities › products › microsoft 365 › excel
excel lottery | Microsoft Community Hub
Let's say this is Column A. Track Hits: In Column B, you'll track each occurrence of the number. You can mark a hit with a 1 or any identifier you choose. Calculate Skips: In Column C, you'll calculate the number of skips before the number hits again. Here's a basic formula you can use in Excel or Google Sheets.
Top answer
1 of 1
2

This requires a little bit of probabilistic reasoning.

As the comments have suggested, given a length n of a row, the probability that this row will win the lottery is comb(n, 15) / comb(25, 15). Therefore, we can construct an array of probabilities, p, for rows of length 15-20:

p = np.array([comb(n, 15) / comb(25,15) for n in range(15, 21)])

Assuming that the rows are indeed randomly generated and independent from one another, we can calculate the probability that the sheet has a row that wins the lottery:

Therefore, we need to count the number of rows of each length in the data sheet (how many rows with 15 entries, how many with 16, etc). Here is a function that can do that:

def CountRowLength(df):
    """Returns a dictionary with keys corresponding to row length and values corresponding to the number of times they occur"""
    answer = dict()
    for _, row in df.iterrows():
        rowLength = len(row.dropna().tolist())
        if rowLength in answer.keys():
            answer[rowLength] += 1
        else:
            answer[rowLength] = 1
    return answer

Therefore, all that remains is to convert this dictionary to an array/list and plug it into the formula from earlier:

# Convert the dictionary to a list
dictionary = CountRowLength(df)
lengths = [dictionary[i] if i in dictionary.keys() else 0 for i in range(15,21)]

# The formula from earlier
total_probability = 1 - np.product([(1-p[i])**lengths[i] for i in range(len(p))])
print(f"The probability that a row from this sheet has a lottery win is {total_probability}")

Then you can take the reciprocal to find the odds.

Find elsewhere
🌐
Indeed
indeed.com › career-advice › career-development › how-to-calculate-probability-in-excel
How To Calculate Probability in Excel (With an Example) | Indeed.com
June 16, 2026 - Learn how to use Microsoft Excel to organize your data into a table and find the probability of a range of outcomes using Excel's built-in math functions.
🌐
My Blog
sevaasindhukarnataka.com › news › calculating-lottery-numbers-using-excel-secrets-to-improving-prediction-effectiveness
Calculating Lottery Numbers Using Excel – Secrets to Improving Prediction Effectiveness -
February 10, 2026 - This spreadsheet template should include columns such as date, lottery results, numbers that appeared, frequency of appearance, etc.Organizing your data well makes it easier to import, edit, and use automatic functions in Excel later on. Using formulas is key to automating the calculation process.
🌐
Someka
someka.net › home › products › excel templates › lifestyle excel templates › lottery simulator excel template
Excel Lottery Simulator | Lottery Simulator Spreadsheet
Free download Excel Lottery Simulator. Create & play your own lotto with preset and custom lottery options. No installation needed.
Published   August 21, 2020
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 4971564 › top-10-most-frequent-numbers-in-a-lotto-excel-spre
Top 10 most frequent numbers in a Lotto excel spreadsheet - Microsoft Q&A
May 28, 2018 - I have a rather large spreadsheet that displays every winning number set (out of 7) and I would like to display the most frequent 10 numbers? Not having much luck. Data is D3:K2648 which includes 7 numbers drawn for each draw plus a bonus number.…
🌐
Quora
quora.com › I-want-to-generate-all-possible-lotto-combinations-on-Excel-and-see-them-all-How-do-I-do-that-The-numbers-range-from-1-to-52
I want to generate all possible lotto combinations on Excel and see them all. How do I do that? The numbers range from 1 to 52. - Quora
Answer: The short answer is that they probably won't fit. There are 52•51•50•49•48•47/6•5•4•3•2 = 20,358,520 different possible draws. Each draw needs six cells to represent the numbers, and possibly additional cells for work areas. The uninteresting way to generate them is ...
🌐
The Spreadsheet Guru
thespreadsheetguru.com › excel › excel templates › excel powerball lottery ticket checker spreadsheet
Excel PowerBall Lottery Ticket Checker Spreadsheet
January 7, 2024 - With this Excel-powered spreadsheet you can type in all your lottery ticket picks and automatically get fed winning numbers once the lottery balls have been picked. I'll provide a little bit of how the spreadsheet is setup and then you can download this Excel file for free and use it to analyze the next time your office pulls together $500 bucks for a chance at living the good life.
🌐
YouTube
youtube.com › watch
Lottery Probability Calculator Excel Win Lottery Consistently ...
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
ExcelDemy
exceldemy.com › home › excel formulas › how to create an option probability calculator in excel
How to Create an Option Probability Calculator in Excel - ExcelDemy
July 11, 2024 - Read More: How to Calculate Empirical Probability with Excel Formula · You can download the practice workbook from here: Option Probability Calculator.xlsx · Probability Formula for Lottery in Excel · How to Calculate Probability Density Function in Excel ·
🌐
MrExcel
mrexcel.com › tech-tv › analyze-lottery-numbers-in-excel
Analyze Lottery Numbers in Excel - TechTV Articles - MrExcel Publishing
If you use =INT(RAND()*49)+1, Excel will return numbers from 1 to 49. With the Analysis Toolpack installed, you can use the simpler =RANDBETWEEN(1,49) to obtain integers between 1 and 49.
🌐
Quora
quora.com › How-would-you-use-Microsoft-Excel-to-make-pick-3-lottery-predictions
How would you use Microsoft Excel to make pick 3 lottery predictions? - Quora
Answer (1 of 2): Lotteries are designed so the the values that won last week are just as likely to win this week as any other combination of values. Excel and an analysis of past winning combinations won’t give you an edge. If you don’t believe me, knock yourself out contributing your money ...
🌐
Statdisk
statdisk.com
Statdisk
Statdisk is a web-based statistical analysis package. It includes over 75 functions and tests, over 400 built-in datasets, and graphing. Statdisk is free to users of Triola Statistics Series textbooks.
🌐
CalculatorSoup
calculatorsoup.com
Calculators | Calculator Soup
Long Multiplication Calculator · Lottery Number Generator · Margin Calculator · Mark-Up Calculator · Math Calculator · Math Calculators · Math Equation Solver · Math Word Problems: Addition & Multiplication · Math Word Problems: Division · Mean Calculator ·