The List.Numbers function in Power Query creates a list of numbers for you. You give it a starting number and how many numbers you want, and it can also step by any amount you like, such as 5, 0.1, or -1.
It’s handy whenever a query needs a sequence it doesn’t already have, like payment numbers, a lookup table, or every number in a range.
Follow along with the example file
List.Numbers Function Examples.xlsx
In the example file, only the examples that start from an Excel table have their own sheet. The rest are queries only, and you can open all of them from Data > Queries & Connections.
List.Numbers Function Syntax
List.Numbers(start as number, count as number, optional increment as nullable number) as list
- start – the first number in the list.
- count – how many numbers you want in the list. A count of 0 gives you an empty list, and a negative count gives the error “The ‘count’ argument is out of range.”
- increment (optional) – how much each number goes up by. Leave it out to step by 1. Use a negative number to count down, or a decimal like 0.1 for smaller steps.
What it returns: A list of numbers that starts at start and has count items, each one increment more than the one before it.
The List.Numbers function is part of the core Power Query M library, so it works wherever Power Query does, including Excel for Microsoft 365, 2024, 2021, 2019, and 2016 (on Windows for 2019 and 2016), and Power BI.
When to Use the List.Numbers Function
Use this function when you need to:
- Create a numbered list, such as 1 to 10, right inside a query
- Generate numbers that go up by a fixed step, like every 5,000 or every 0.1
- Count down, for example the last five years with the latest year first
- Build a small lookup or conversion table from scratch
- Turn a start number and a quantity into one row per number
- Find which numbers are missing from a sequence, like skipped cheque or invoice numbers
If you need a list of dates rather than numbers, the List.Dates function works the same way, with a start date, a count, and a step.
And when the next number depends on a condition rather than a fixed step (say, keep doubling until you pass 1,000), the List.Generate function is the better fit.
Example 1: Generate a Sequence of Numbers
Let’s start with the simplest use. Suppose you want the numbers 1 to 10 in a list, maybe to number ten rows or ten slots in a schedule.
In Excel, go to Data > Get Data > From Other Sources > Blank Query. In the Power Query Editor that opens, type this formula in the formula bar:
= List.Numbers(1,10)
Result: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Here, 1 is the starting number and 10 is how many numbers you want. Since there’s no third argument, each number goes up by 1.
For this exact case (whole numbers going up by 1), you can also type {1..10}, which gives the same list. List.Numbers is the one to use when you want a different step, a countdown, or decimals, which the next examples cover.
And if what you really want is a running number next to the rows of an existing table, the Table.AddIndexColumn function adds that column in one step.
Example 2: Count by a Step Other Than 1
Here’s where the third argument comes in. Suppose your sales team earns a bonus at every 5,000 in sales, starting at 10,000, and you want the six bonus thresholds as a list.
Create a new blank query and use this formula:
= List.Numbers(10000,6,5000)
Result: 10000, 15000, 20000, 25000, 30000, 35000

Here, the list starts at 10000, has 6 numbers, and each one is 5000 more than the one before it.
Notice that the second argument is how many numbers you get, not the last number. If you think in terms of an end value, work out the count first: (35000 – 10000) / 5000 + 1 = 6.
Example 3: Count Down with a Negative Step
Sometimes you want the numbers going down instead of up. Suppose you’re building a report that shows the last five years with the latest year first, starting from 2026.
Create a new blank query and use this formula:
= List.Numbers(2026,5,-1)
Result: 2026, 2025, 2024, 2023, 2022

Here, the step is -1, so each number is 1 less than the one before it. The count is still 5, the number of items you want, so it stays positive.
The {2026..2022} shortcut won’t work here. It only counts up, so going from a bigger number to a smaller one gives you an empty list.
Example 4: Use a Decimal Step (and Fix the Tiny Rounding Errors)
This next one catches a lot of people. Suppose you want a list of rates from 0 to 1 in steps of 0.1 (0%, 10%, 20%, and so on up to 100%), for a what-if table.
Create a new blank query and use this formula:
= List.Numbers(0,11,0.1)
Result: 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1

The list looks right. But now try to check whether 0.3 is in it. Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= List.Contains(Source,0.3)
Result: FALSE

Here, Source is the first step, which holds the list from List.Numbers. The List.Contains function checks whether 0.3 is in that list, and it says no, even though you can see 0.3 in the preview.
That’s because computers store decimals like 0.1 in binary, which can’t hold them exactly. As List.Numbers adds 0.1 again and again, tiny errors creep in, so the fourth value is really 0.30000000000000004.
Power Query rounds the number for display, so you never see the extra bit. But it’s still there, so filtering for 0.3 or merging this list with a table that has 0.3 in it won’t find a match.
If you want to see those hidden digits yourself, add another step (with the fx icon) and enter = List.Transform(Source,each Number.ToText(_,"R")). The “R” format writes out the exact number Power Query has stored.
The fix is to round each number. (In the example file, Example 4 has two queries, one showing the problem and this one with the fix.)
Create a new blank query, open the Advanced Editor (Home > Advanced Editor), and use this code:
let
Source = List.Numbers(0,11,0.1),
Rounded = List.Transform(Source,each Number.Round(_,1))
in
Rounded
Result: 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1

Here, the Source step creates the same list as before. The Rounded step uses the List.Transform function to round every number in that list to one decimal place.
Inside List.Transform, each runs the same calculation on every item in the list, and _ stands for the item being worked on. So Number.Round(_,1) rounds each number to one decimal place.
The list looks the same as before, but now each value is exactly what it shows. If you add the same check after the Rounded step, List.Contains(Rounded,0.3) returns TRUE.
Steps like 0.25 or 0.5 don’t have this problem, because those decimals can be stored exactly. It’s steps like 0.1 where you’ll want the rounding step.
Another way to get clean tenths is to create whole numbers and divide them, like List.Transform(List.Numbers(0,11),each _/10). Dividing whole numbers doesn’t pile up the tiny errors, so you get the same clean list without choosing how many decimals to round to.
Example 5: Use a Count Stored in an Excel Table
In real work, the count usually comes from your data rather than being typed into the formula. Below is a table named LoanDetails with a car loan and its term in months, and I want a list of payment numbers, one for each month.

In the code below, the Source line uses the Excel.CurrentWorkbook function to pull the LoanDetails table into Power Query by its name.
Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="LoanDetails"]}[Content],
#"Payment Numbers" = List.Numbers(1,Source{0}[#"Term (Months)"])
in
#"Payment Numbers"
Result: 1, 2, 3, and so on up to 18

Here, Source{0} picks the first row of the table (Power Query counts rows from 0), and [#"Term (Months)"] picks the value in that column, which is 18. List.Numbers then creates 18 payment numbers starting at 1.
The #"..." around the column name is needed because the name has spaces and brackets in it.
Since the count comes from the table, the list follows your data. If you change the term to 24 in the table and refresh the query, you get 24 payment numbers.
If the term cell is blank, Power Query reads it as null, and you get the error “We cannot convert the value null to type Number.” So make sure the cell has a number before you refresh.
Also, keep the term a whole number. A decimal count gets rounded up, so a term of 18.5 would give you 19 payment numbers.
Example 6: Turn the List into a Table
A list is a single column of values with no header, which is fine for many jobs. But often you want a proper table, so you can add more columns next to it.
Suppose you want a Celsius to Fahrenheit conversion table, from -10°C to 40°C in steps of 5.
Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Table.FromColumns({List.Numbers(-10,11,5)},type table [Celsius=number]),
#"Added Fahrenheit" = Table.AddColumn(Source,"Fahrenheit",each [Celsius]*9/5+32,type number)
in
#"Added Fahrenheit"
Result: A two-column table with Celsius from -10 to 40 and the matching Fahrenheit values (14 to 104)

Here, List.Numbers creates the 11 Celsius values, from -10 to 40 in steps of 5. The Table.FromColumns function turns that list into a table with one column named Celsius, and type table [Celsius=number] sets it as a number column.
The curly brackets around List.Numbers matter. Table.FromColumns expects a list of columns, so {List.Numbers(-10,11,5)} passes our one list as the table’s only column.
The second step uses the Table.AddColumn function to add a Fahrenheit column, using the usual formula (Celsius × 9/5 + 32).
Example 7: Expand Number Ranges into Separate Rows
This next one comes up quite often in warehouse and ticketing data.
Below is a table named BoxBatches with the first box number and the number of boxes in each batch, and I want one row per box with its box number in a new Box No column.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="BoxBatches"]}[Content],
#"Added Box No" = Table.AddColumn(Source,"Box No",each List.Numbers([First Box No],[Boxes]),type list),
#"Expanded Box No" = Table.ExpandListColumn(#"Added Box No","Box No")
in
#"Expanded Box No"
Result: 9 rows, one for each box, with box numbers 101 to 109

Here, the Added Box No step runs List.Numbers once for each row. For batch B-01, it starts at 101 and creates 3 numbers (101, 102, 103), so each cell in the new column holds a list.
The Table.ExpandListColumn function then gives each number in those lists its own row. So batch B-01 becomes three rows, B-02 becomes four, and B-03 becomes two.
Example 8: Find Missing Numbers in a Sequence
Here’s a practical check you can run on any numbered records. Below is a table named IssuedCheques with the cheques written from a book of 12 cheques (100201 to 100212), and I want to find the cheque numbers that are missing from the list.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="IssuedCheques"]}[Content],
#"Missing Cheques" = List.Difference(List.Numbers(100201,12),Source[Cheque No])
in
#"Missing Cheques"
Result: 100203, 100207, 100210, 100212

Here, List.Numbers(100201,12) creates every cheque number the book should have, from 100201 to 100212. Source[Cheque No] is the list of cheque numbers that were actually written.
The List.Difference function then returns the numbers in the first list that aren’t in the second, which are the four missing cheques.
Because the full list comes from the cheque book itself, it also catches 100212, the last cheque in the book. A range built from the smallest and largest cheque numbers in the table would stop at 100211 and miss it.
The flip side is that the start number and the count are typed into the query. For a new cheque book, change 100201 and 12 to match it.
Example 9: Create Numbered Codes like TKT-001
Now let’s turn numbers into codes. Suppose you’re setting up an event and want six ticket codes, TKT-001 to TKT-006, with every number padded to three digits.
Create a new blank query and use this formula:
= List.Transform(List.Numbers(1,6),each "TKT-" & Text.PadStart(Text.From(_),3,"0"))
Result: TKT-001, TKT-002, TKT-003, TKT-004, TKT-005, TKT-006

Here, List.Numbers creates the numbers 1 to 6, and the List.Transform function changes each one into a code. Inside it, the Text.From function turns the number into text, and the Text.PadStart function adds zeros at the front until it’s 3 characters long.
To start somewhere else, change the first argument. For example, List.Numbers(41,6) gives TKT-041 to TKT-046.
If you prefer a shorter version, the Number.ToText function can do the padding in one step. Use = List.Transform(List.Numbers(1,6),each "TKT-" & Number.ToText(_,"000")), where the format “000” always shows at least three digits.
Other Excel Articles You May Also Like:
- Number.RoundDown function
- List.FirstN – Use List.FirstN in Power Query M to get the first items of a list.
- List.Accumulate – Use List.Accumulate in Power Query M to loop through a list.
- Number.Round – Use Number.Round in Power Query M to round numbers.
- Number.RoundUp – Use Number.RoundUp in Power Query M to round numbers up.
- List.Skip – Use List.Skip in Power Query M to skip items at the start of a list.
- List.Sort – Use List.Sort in Power Query M to sort a list.
- Number.IntegerDivide – Use Number.IntegerDivide in Power Query M to divide and drop the remainder.