Skip to main content
 

How to generate a list of all possible 4 digits combinations in Excel?

Author: Sun Last Modified: 2024-08-29

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 screenshot of using formula to generate a 4 digits combinations list


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.

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:

a screenshot of manually creating a sequence list from 0 to 9

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:

a screenshot of formatting a column as Text

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

a screenshot of enabling the List All Combinations feature of Kutools

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 a screenshot of the selection 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.

a screenshot of creating combinations list in the List All Combinations dialog box

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.

a screenshot of selecting a destination cell

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

a screenshot showing the genarated 4 digits combinations list

Click here to know more about List All combinations


List All Possible 4 Digits Combinations

 

A List all possible 4 digits combinations with Insert Sequence Number

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:

a screenshot of enabling the Insert Sequence Number feature of Kutools

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

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

a screenshot of creating a new sequence

(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:

a screenshot of setting the sequence with 4 digits combinations

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

a screenshot showing how to fill a range with the created sequence

Click here to know the details about Insert Sequence Number.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!