Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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

A list of all possible 4 digits combinations with List All Combinations good idea3

List all possible 4 digits combinations with Insert Sequence Number good idea3


Seconds to list all combinations of two or more lists in Excel

For example, you have two list of values, what you want is to combine these two lists to get all possible combinations as below screenshot shown. In general, you can combine them one by one, but if there are dozens of values needed to combine, this manual method cost much time. In this case, you can try to apply Kutools for Excel's List All Combinations utility, which can quickly generate all combinations of two or more lists you need.  Click for full-featured 60 days free trial!
list combination
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.
Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.


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.

doc list 4 digits combinations 1


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.

  Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

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:

doc list 4 digits combinations 2

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:

doc list 4 digits combinations 3

3. Click Kutools > Insert > List All Combinations. See screenshot:

doc list all digits combinations 12

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 doc button 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.

doc list 4 digits combinations 12

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.

doc list 4 digits combinations 6

6. Click OK. Now all the 4 digits combinations of 0-9 are listing.

doc list 4 digits combinations 7

Click here to know more about List All combinations


In Kutools for Excel, you can use Insert Sequence Number to solve this task, too.

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select a large range of cells (more than 100000 cells), and click Kutools > Insert > Insert Sequence Number. See screenshot:

doc list all digits combinations 13

2. Then in the Insert Sequence Number dialog, do as below:

(1) Click New to create a new sequence. See screenshot:

doc list 4 digits combinations 9

(2) Type 0 as the Start number, 1 as the Increment, and 4 as the No. of digits, and check End number option and type 9999 into the textbox. See screenshot:

doc list 4 digits combinations 10

3. Click Add to add this sequence rule, and then click Fill Range. see screenshot:

doc list 4 digits combinations 11

Click here to know the details about Insert Sequence Number.


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • 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.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    dinesh · 4 months ago
    hi from numbers 1 to 8 how many mixed 4 number combinations do i get
    • To post as a guest, your comment is unpublished.
      Sunny · 3 months ago
      Hi,dinesh,just try the third method, you can get the final result by yourselft.
  • To post as a guest, your comment is unpublished.
    BHAVIK VIRA · 9 months ago
    I WANT COMBINATION OF 1,2,3,4,5,6,7,8 PLEASE PROVIDE THE EXCEL SHEET

    T
    • To post as a guest, your comment is unpublished.
      Sunny · 7 months ago
      Just try above method, you can do by yourself.
  • To post as a guest, your comment is unpublished.
    Rajeev · 9 months ago
    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!
  • To post as a guest, your comment is unpublished.
    Fábio Ávila · 10 months ago
    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!
    • To post as a guest, your comment is unpublished.
      Sunny · 9 months ago
      Sorry, this is too difficult to execute.
  • To post as a guest, your comment is unpublished.
    jeff · 3 years ago
    hi. thanks for the stuff