How to generate a list of all possible 4 digits combinations in Excel?
In some cases, we may need to generate a list of all possible 4 digits combinations of number 0 to 9, which means to generate a list of 0000, 0001, 0002…9999. To quickly solve the list task in Excel, I introduce some tricks for you.
A list of all possible 4 digits combinations with formula
In Excel, you can use below formula to list all possible 4 digits combinations of number 0 to 9.
Select a blank cell and type this formula =TEXT(ROW(A1)-1,"0000") into it, and press Enter key, then drag the autofill handle down until all the 4 digits combinations are listing.
A list of all possible 4 digits combinations with List All Combinations
With the formula to drag down until all combinations are listed is tedious. However, if you have Kutools for Excel installed, you can use its List All Combinations utility to quickly list all 4 digits combinations.
1. Select a cell, A1, type 0 into it, then go down next cell and type 1 into it. And then select A1 and A2, and drag the autofill handle down until number 9 appears. See screenshot:
2. Then you need to format a column as Text (the column will put the combinations), click at a blank column header, says Column F, and then right click to select Format Cells, and select Text under Number tab in Format Cells dialog, and click OK . See screenshot:
3. Click Kutools > Insert > List All Combinations. See screenshot:
4. A List All Combinations dialog pops out, and you just need to do below operations:
(1) Select Value in the Type list;
(2) Click to select your number list, (you also can directly type the numbers separated by commas into textbox), and click Add to add the first list into Combinations list;
(3) Repeat step (2) for three times to add other three number lists into Combinations list.
5. Click Ok. Now a dialog pops out to remind you select a cell to put the result, here you need to select the first cell of the column you format as Text.
6. Click OK. Now all the 4 digits combinations of 0-9 are listing.
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.
Hi, SACHIN, you can use the List all combination utility of Kutools for Excel to list all combinations, then use the Select cells with max or min value utility of Kutools for Excel to find tge maximum combination value.
I have a question! How to list all possible combination of numbers? For example, I have these numbers: 2, 2, 2, 1, 0. I want to generate all possible combinations of these five numbers. For example 22210, 10222, 21220, 20122, 21022... and so on. Please help!
Hello. Thanks for the List All combinations tool. However, some combinations exceed the total number of rows excel can offer in a given column (1,048,576). Is it possible to let the list continue in another column within the same sheet? Or even have the tool in word or text which doesn't limit the rows? I appreciate your feedback!