Excel this row number

Date yes Add (Subtract) Days to a Date Concatenate Dates Convert Date to Number Convert Date to Text Month Name to Number Create Date Range from Dates Day Number of Year Month Name from Date First Day of Month Add (Subtract) Weeks to a Date If Functions with Dates Max Date Number of Days Between Dates Number of Days in a Month Number of Weeks Between Dates Number of Years Between Dates Split Date & Time into Separate Cells Countdown Remaining Days Insert Dates Random Date Generator Using Dynamic Ranges — Year to Date Values Add (Subtract) Years to a Date Date Formula Examples Extract Day from Date Get Day Name from Date Count Days Left in Month / Year Count Workdays Left in Month / Year Get Last Day of Month Last Business Day of Month / Year Number of Work / Business Days in Month Weekday Abbreviations Auto Populate Dates Number of Months Between Dates Quarter from a Date Years of Service Change Date Format Compare Dates Time yes Add (Subtract) Hours to Time Add (Subtract) Minutes to Time Add (Subtract) Seconds to Time Add Up time (Total Time) Time Differences Change Time Format Convert Minutes to Hours Convert Time to Decimal Convert Time to Hours Convert Time to Minutes Convert Time to Seconds Military Time Round Time to Nearest 15 Minutes Overtime Calculator Number of Hours Between Times Convert Seconds to Minutes, Hours, or Time Count Hours Worked Time Differences Time Format — Show Minutes Seconds Text yes Add Commas to Cells Get First Word from Text Capitalize First Letter Clean & Format Phone #s Remove Extra Trailing / Leading Spaces Add Spaces to Cell Assign Number Value to Text Combine Cells with Comma Combine First and Last Names Convert Text String to Date Convert Text to Number Extract Text From Cell Get Last Word Remove Unwated Characters Extract Text Before or After Character How to Split Text String by Space, Comma, & More Remove Special Characters Remove First Characters from Left Substitute Multiple Values Switch First & Last Names w/ Commas Remove Specific Text from a Cell Extract Text Between Characters (Ex. Parenthesis) Add Leading Zeros to a Number Remove Line Breaks from Text Remove all Numbers from Text Reverse Text Remove Non-Numeric Characters Remove Last Character(s) From Right Separate First and Last Names Separate Text & Numbers Round yes Round Formulas Round Price to Nearest Dollar or Cent Round to Nearest 10, 100, or 1000 Round to Nearest 5 or .5 Round Percentages Round to Significant Figures Count yes Count Blank and Non-blank Cells Count Cells Between Two Numbers Count Cells not Equal to Count if Cells are in Range Count Times Word Appears in Cell Count Words in Cell Count Specific Characters in Column Count Total Number of Characters in Column Count Cells that Equal one of two Results Count Cells that do not Contain Count Cells that Contain Specific Text Count Unique Values in Range Countif — Multiple Criteria Count Total Number of Cells in Range Count Cells with Any Text Count Total Cells in a Table Lookup yes Two Dimensional VLOOKUP VLOOKUP Simple Example Vlookup — Multiple Matches Case Sensitive Lookup Case Sensitive VLOOKUP Sum if — VLOOKUP Case Sensitive Lookup Case Sensitive VLOOKUP Find Duplicates w/ VLOOKUP or MATCH INDEX MATCH MATCH Lookup — Return Cell Address (Not Value) Lookup Last Value in Column or Row Reverse VLOOKUP (Right to Left) Risk Score Bucket with VLOOKUP Sum with a VLOOKUP Function VLOOKUP & INDIRECT VLOOKUP Concatenate VLOOKUP Contains (Partial Match) 17 Reasons Why Your XLOOKUP is Not Working Double (Nested) XLOOKUP — Dynamic Columns IFERROR (& IFNA) XLOOKUP Lookup Min / Max Value Nested VLOOKUP Top 11 Alternatives to VLOOKUP (Updated 2022!) VLOOKUP – Dynamic Column Reference VLOOKUP – Fix #N/A Error VLOOKUP – Multiple Sheets at Once VLOOKUP & HLOOKUP Combined VLOOKUP & MATCH Combined VLOOKUP Between Worksheets or Spreadsheets VLOOKUP Duplicate Values VLOOKUP Letter Grades VLOOKUP Return Multiple Columns VLOOKUP Returns 0? Return Blank Instead VLOOKUP w/o #N/A Error XLOOKUP Multiple Sheets at Once XLOOKUP Between Worksheets or Spreadsheets XLOOKUP by Date XLOOKUP Duplicate Values XLOOKUP Multiple Criteria XLOOKUP Return Multiple Columns XLOOKUP Returns 0? Return Blank Instead XLOOKUP Text XLOOKUP with IF XLOOKUP With If Statement Misc. yes Sort Multiple Columns Use Cell Value in Formula Percentage Change Between Numbers Percentage Breakdown Rank Values Add Spaces to Cell CAGR Formula Average Time Decimal Part of Number Integer Part of a Number Compare Items in a List Dealing with NA() Errors Get Worksheet Name Wildcard Characters Hyperlink to Current Folder Compound Interest Formula Percentage Increase Create Random Groups Sort with the Small and Large Functions Non-volatile Function Alternatives Decrease a Number by a Percentage Calculate Percent Variance Profit Margin Calculator Convert Column Number to Letter Get Full Address of Named Range Insert File Name Insert Path Latitute / Longitude Functions Replace Negative Values Reverse List Range Convert State Name to Abbreviation Create Dynamic Hyperlinks Custom Sort List with Formula Data Validation — Custom Formulas Dynamic Sheet Reference (INDIRECT) Reference Cell in Another Sheet or Workbook Get Cell Value by Address Get Worksheet Name Increment Cell Reference List Sheet Names List Skipped Numbers in Sequence Return Address of Max Value in Range Search by Keywords Select Every Other (or Every nth) Row Basics yes Cell Reference Basics — A1, R1C1, 3d, etc. Add Up (Sum) Entire Column or Row Into to Dynamic Array Formulas Conversions yes Convert Time Zones Convert Celsius to Fahrenheit Convert Pounds to Kilograms Convert Time to Unix Time Convert Feet to Meters Convert Centimeters to Inches Convert Kilometers to Miles Convert Inches to Feet Convert Date to Julian Format Convert Column Letter to Number Tests yes Test if a Range Contains any Text Test if any Cell in Range is Number Test if a Cell Contains a Specific Value Test if Cell Contains Any Number Test if Cell Contains Specific Number Test if Cell is Number or Text If yes Percentile If Subtotal If Sumproduct If Large If and Small If Median If Concatentate If Max If Rank If TEXTJOIN If Sum yes Sum if — Begins With / Ends With Sum if — Month or Year to Date Sum if — By Year Sum if — Blank / Non-Blank Sum if — Horizontal Sum Count / Sum If — Cell Color INDIRECT Sum Sum If — Across Multiple Sheets Sum If — By Month Sum If — Cells Not Equal To Sum If — Not Blank Sum if — Between Values Sum If — Week Number Sum Text Sum if — By Category or Group Sum if — Cell Contains Specific Text (Wildcards) Sum if — Date Rnage Sum if — Dates Equal Sum if — Day of Week Sum if — Greater Than Sum if — Less Than Average yes Average Non-Zero Values Average If — Not Blank Average — Ignore 0 Average — Ignore Errors Math yes Multiplication Table Cube Roots nth Roots Square Numbers Square Roots Calculations yes Calculate a Ratio Calculate Age KILLLLLLL Calculate Loan Payments GPA Formula Calculate VAT Tax How to Grade Formulas Find yes Find a Number in a Column / Workbook Find Most Frequent Numbers Find Smallest n Values Find nth Occurance of Character in Text Find and Extract Number from String Find Earliest or Latest Date Based on Criteria Find First Cell with Any Value Find Last Row Find Last Row with Data Find Missing Values Find Largest n Values Most Frequent Number Conditional Formatting yes Conditional Format — Dates & Times Conditional Format — Highlight Blank Cells New Functions XLOOKUP Replaces VLOOKUP, HLOOKUP, and INDEX / MATCH Logical yes AND Checks whether all conditions are met. TRUE/FALSE IF If condition is met, do something, if not, do something else. IFERROR If result is an error then do something else. NOT Changes TRUE to FALSE and FALSE to TRUE. OR Checks whether any conditions are met. TRUE/FALSE XOR Checks whether one and only one condition is met. TRUE/FALSE Lookup & Reference yes FALSE The logical value: FALSE. TRUE The logical value: TRUE. ADDRESS Returns a cell address as text. AREAS Returns the number of areas in a reference. CHOOSE Chooses a value from a list based on it’s position number. COLUMN Returns the column number of a cell reference. COLUMNS Returns the number of columns in an array. HLOOKUP Lookup a value in the first row and return a value. HYPERLINK Creates a clickable link. INDEX Returns a value based on it’s column and row numbers. INDIRECT Creates a cell reference from text. LOOKUP Looks up values either horizontally or vertically. MATCH Searches for a value in a list and returns its position. OFFSET Creates a reference offset from a starting point. ROW Returns the row number of a cell reference. ROWS Returns the number of rows in an array. TRANSPOSE Flips the oriention of a range of cells. VLOOKUP Lookup a value in the first column and return a value. Date & Time yes DATE Returns a date from year, month, and day. DATEDIF Number of days, months or years between two dates. DATEVALUE Converts a date stored as text into a valid date DAY Returns the day as a number (1-31). DAYS Returns the number of days between two dates. DAYS360 Returns days between 2 dates in a 360 day year. EDATE Returns a date, n months away from a start date. EOMONTH Returns the last day of the month, n months away date. HOUR Returns the hour as a number (0-23). MINUTE Returns the minute as a number (0-59). MONTH Returns the month as a number (1-12). NETWORKDAYS Number of working days between 2 dates. NETWORKDAYS.INTL Working days between 2 dates, custom weekends. NOW Returns the current date and time. SECOND Returns the second as a number (0-59) TIME Returns the time from a hour, minute, and second. TIMEVALUE Converts a time stored as text into a valid time. TODAY Returns the current date. WEEKDAY Returns the day of the week as a number (1-7). WEEKNUM Returns the week number in a year (1-52). WORKDAY The date n working days from a date. WORKDAY.INTL The date n working days from a date, custom weekends. YEAR Returns the year. YEARFRAC Returns the fraction of a year between 2 dates. Engineering yes CONVERT Convert number from one unit to another. Financial yes FV Calculates the future value. PV Calculates the present value. NPER Calculates the total number of payment periods. PMT Calculates the payment amount. RATE Calculates the interest Rate. NPV Calculates the net present value. IRR The internal rate of return for a set of periodic CFs. XIRR The internal rate of return for a set of non-periodic CFs. PRICE Calculates the price of a bond. YIELD Calculates the bond yield. INTRATE The interest rate of a fully invested security. Information yes CELL Returns information about a cell. ERROR.TYPE Returns a value representing the cell error. ISBLANK Test if cell is blank. TRUE/FALSE ISERR Test if cell value is an error, ignores #N/A. TRUE/FALSE ISERROR Test if cell value is an error. TRUE/FALSE ISEVEN Test if cell value is even. TRUE/FALSE ISFORMULA Test if cell is a formula. TRUE/FALSE ISLOGICAL Test if cell is logical (TRUE or FALSE). TRUE/FALSE ISNA Test if cell value is #N/A. TRUE/FALSE ISNONTEXT Test if cell is not text (blank cells are not text). TRUE/FALSE ISNUMBER Test if cell is a number. TRUE/FALSE ISODD Test if cell value is odd. TRUE/FALSE ISREF Test if cell value is a reference. TRUE/FALSE ISTEXT Test if cell is text. TRUE/FALSE N Converts a value to a number. NA Returns the error: #N/A. TYPE Returns the type of value in a cell. Math yes ABS Calculates the absolute value of a number. AGGREGATE Define and perform calculations for a database or a list. CEILING Rounds a number up, to the nearest specified multiple. COS Returns the cosine of an angle. DEGREES Converts radians to degrees. DSUM Sums database records that meet certain criteria. EVEN Rounds to the nearest even integer. EXP Calculates the exponential value for a given number. FACT Returns the factorial. FLOOR Rounds a number down, to the nearest specified multiple. GCD Returns the greatest common divisor. INT Rounds a number down to the nearest integer. LCM Returns the least common multiple. LN Returns the natural logarithm of a number. LOG Returns the logarithm of a number to a specified base. LOG10 Returns the base-10 logarithm of a number. MOD Returns the remainder after dividing. MROUND Rounds a number to a specified multiple. ODD Rounds to the nearest odd integer. PI The value of PI. POWER Calculates a number raised to a power. PRODUCT Multiplies an array of numbers. QUOTIENT Returns the integer result of division. RADIANS Converts an angle into radians. RAND Calculates a random number between 0 and 1. RANDBETWEEN Calculates a random number between two numbers. ROUND Rounds a number to a specified number of digits. ROUNDDOWN Rounds a number down (towards zero). ROUNDUP Rounds a number up (away from zero). SIGN Returns the sign of a number. SIN Returns the sine of an angle. SQRT Calculates the square root of a number. SUBTOTAL Returns a summary statistic for a series of data. SUM Adds numbers together. SUMIF Sums numbers that meet a criteria. SUMIFS Sums numbers that meet multiple criteria. SUMPRODUCT Multiplies arrays of numbers and sums the resultant array. TAN Returns the tangent of an angle. TRUNC Truncates a number to a specific number of digits. Stats yes AVERAGE Averages numbers. AVERAGEA Averages numbers. Includes text & FALSE =0, TRUE =1. AVERAGEIF Averages numbers that meet a criteria. AVERAGEIFS Averages numbers that meet multiple criteria. CORREL Calculates the correlation of two series. COUNT Counts cells that contain a number. COUNTA Count cells that are non-blank. COUNTBLANK Counts cells that are blank. COUNTIF Counts cells that meet a criteria. COUNTIFS Counts cells that meet multiple criteria. FORECAST Predict future y-values from linear trend line. FREQUENCY Counts values that fall within specified ranges. GROWTH Calculates Y values based on exponential growth. INTERCEPT Calculates the Y intercept for a best-fit line. LARGE Returns the kth largest value. LINEST Returns statistics about a trendline. MAX Returns the largest number. MEDIAN Returns the median number. MIN Returns the smallest number. MODE Returns the most common number. PERCENTILE Returns the kth percentile. PERCENTILE.INC Returns the kth percentile. Where k is inclusive. PERCENTILE.EXC Returns the kth percentile. Where k is exclusive. QUARTILE Returns the specified quartile value. QUARTILE.INC Returns the specified quartile value. Inclusive. QUARTILE.EXC Returns the specified quartile value. Exclusive. RANK Rank of a number within a series. RANK.AVG Rank of a number within a series. Averages. RANK.EQ Rank of a number within a series. Top Rank. SLOPE Calculates the slope from linear regression. SMALL Returns the kth smallest value. STDEV Calculates the standard deviation. STDEV.P Calculates the SD of an entire population. STDEV.S Calculates the SD of a sample. STDEVP Calculates the SD of an entire population TREND Calculates Y values based on a trendline. Text yes CHAR Returns a character specified by a code. CLEAN Removes all non-printable characters. CODE Returns the numeric code for a character. CONCATENATE Combines text together. DOLLAR Converts a number to text in currency format. EXACT Test if cells are exactly equal. Case-sensitive. TRUE/FALSE FIND Locates position of text within a cell.Case-sensitive. LEFT Truncates text a number of characters from the left. LEN Counts number of characters in text. LOWER Converts text to lower case. MID Extracts text from the middle of a cell. PROPER Converts text to proper case. REPLACE Replaces text based on it’s location. REPT Repeats text a number of times. RIGHT Truncates text a number of characters from the right. SEARCH Locates position of text within a cell.Not Case-sensitive. SUBSTITUTE Finds and replaces text. Case-sensitive. TEXT Converts a value into text with a specific number format. TRIM Removes all extra spaces from text. UPPER Converts text to upper case. VALUE Converts a number stored as text into a number.

Asked
12 years, 7 months ago

Viewed
8k times

So I am writing some formulas for my spreadsheets and wondered if there was a placeholder for this row number.

For example say I am using the formula:

=C4+SUM(F4:N4)

I know I can autofill this, but what I really want is some stock formula like:

=C{this.row}+SUM(F{this.row}:N{this.row})

Is this possible? Thanks

asked Aug 26, 2010 at 16:42

The function you need is INDIRECT(CELL/RANGE as string)

The INDIRECT function takes in a string and uses it to evaluate a cell or range location. This is where you get the flexibility (aka indirection) that you need.

eg your formula would be:

=INDIRECT("C" & ROW()) + SUM(INDIRECT("F" & ROW() & ":N" & ROW()))

answered Aug 26, 2010 at 16:56

Basic's user avatar

BasicBasic

26.1k24 gold badges112 silver badges197 bronze badges

0

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

This article describes the formula syntax and usage of the ROW function in Microsoft Excel.

Description

Returns the row number of a reference.

Syntax

ROW([reference])

The ROW function syntax has the following arguments:

  • Reference    Optional. The cell or range of cells for which you want the row number.

    • If reference is omitted, it is assumed to be the reference of the cell in which the ROW function appears.

    • If reference is a range of cells, and if ROW is entered as a vertical array, ROW returns the row numbers of reference as a vertical array.

    • Reference cannot refer to multiple areas.

Examples

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=ROW()

Row in which the formula appears

2

=ROW(C10)

Row of the reference

10

Need more help?

Skip to content

The Excel ROW Function Explained: How To Find a Row Number Easily

The Excel ROW Function Explained: How To Find a Row Number Easily

Ever had to use a row number in a formula or function in Excel? Yeah, it’s right there to the left of the sheet – no big deal.

But what if you need the same for multiple formulas? You can’t enter each of them manually, can you? Well, the good news is that you don’t even need to do it manually. Instead, Excel will do it for you✌

The ROW function of Excel returns the row number for any given cell. And this guide teaches you all that you need to know about the ROW function. So without further ado, let’s dive right in.

Also, download our free sample workbook here to tag along with the guide.

Get the row number from the ROW function

Getting a row number is easy—just find the cell you’re interested in, click on it, and look at the highlighted row number on the left side of the window. Like this:

A single cell selected in the fourth column

That’s easy, right? But what if you need to add the row number in a formula? How do you get the row number for any given cell?

That’s where we use the ROW function. It is a built-in function in Excel and requires only one argument.

So how do we use it? Let’s see that right below👇

The formula of the Excel ROW function is pretty simple.

=ROW(argument)

You can even execute it with no arguments even. Upon doing so, the function returns the row number of the active cell.

For instance, let’s say we apply the ROW function in cell C7.

  1. Select cell C7 on the worksheet.
Selecting the serial number C7.
  1. In the selected cell, type the ROW function as follows:

= ROW() 

  1. Hit Enter.
First cell return row number 7.

The ROW function returns 7. This is because Cell C7 (the active cell) lies in Row 7.

  1. Similarly, if you try writing:

= ROW(M9)

Here’s what happens:

The first row returns 9th row number in Excel.

Excel returns the number 9 as the referred cell (Cell M9) lies in Row 9. It’s as easy as that😉

You can also try the same with an array. The Excel row function returns the row number for each of the cells in the defined array.

Let’s understand this with an example.

Say we apply the function in cell A2, and the ROW function takes an argument of range D3:D9.

Selecting the range serial numbers.

The result will be something like this:

The ROW formula shows third row as start of range.

The ROW function returns the row numbers of the selected range of cells in the form of an array.

This function proves super helpful when nested in complex formulas.

How to get the row number with the ROWS function

The ROWS function deals with an array of cells and gives the count of the rows in the range.

Its syntax reads as follows:

=ROWS (range)

An important point to note here is that the arguments given in the ROWS function are not optional.

You must specify a range of cells for Excel to count the rows using the ROWS function.

Kasper Langmann, Microsoft Office Specialist

So, let’s see the ROWS function in action🔮

Say we want a count of the rows in between cells A2 and A11. To do so:

  1. Write the ROWS function as follows:

=ROWS(A2:A11)

Using range in new cell with ROW function.

The function returns 10, which is equal to the count of rows between Cell A2 to A11.

Note that the ROWS function only counts the number of cells (or rows) in a dataset, not the values in the cells.

The ROWS function would work even if the data set contains empty cells🤩

Kasper Langmann, Microsoft Office Specialist

The ROW vs. ROWS Function

You must be thinking – both the ROW and the ROWS function look the same and almost sound the same too. So what is the difference between the ROW function and the ROWS function?

Well, both the ROW functions are quite different from each other. Here’s how:

If we use a single argument, say D3, with both functions, the results will be different with each of them.

  1. The ROW function will return the row number of Cell D3 as shown below:
Excel ROW function returns the row number 3

Whereas, the ROWS function will return the count of the rows between the specified cells.

As D3 is a single cell, there’s only one row to it.

Using ROWS function returns the count of the rows.

The difference between the two functions becomes pretty clear from the above example. And it doesn’t stop here.

  1. With a range of cells defined, the ROW function returns the row number for each cell of that range. In contrast to the above, the ROWS function returns the count of the rows in the defined range of cells.
  2. Moreover, you can use the ROW function without any arguments. And the function will simply return the row number of the active cell. However, if you try omitting the argument for the ROWS function, Excel will return an error prompt🚩

Examples of ROW And ROWS

Let’s see some common examples of using the ROW and ROWS functions with other functions to better understand how they work.

How about using these functions together with the INDEX and the MATCH function? And by the way, if you are a Harry Potter fan, you are simply going to love the following example 💕

Excel example reference

In this dataset, we want to know the row number of the O.W.L Eleven.

And the formula we are to apply looks like this:

= ROW (INDEX (A1:A8, MATCH (E6, B1:B8,0)))

Following formula uses MATCH function, INDEX and ROW function.

Yes, we know – that’s terribly confusing. So we’ll take you through all the parts of this formula one by one:

  • MATCH(E6,B1:B8,0) – the MATCH function returns the cell’s (E6) relative position in the range B1:B8, which, in this case, is 3.
  • INDEX(A1:A8, MATCH(E6, B1:B8,0)) – the INDEX function will return the cell value (Hermoine Granger) that comes on Number 3 (the matched value) within the given range.
  • = ROW(INDEX(A1:A8, MATCH(E6,B1:B8,0))) – the ROW function returns the row number for the cell returned by the INDEX function.

All done! Press Enter and here are the results 💯

Using the ROW function to get a row number

Excel finds the row number where the O.W.L Eleven lies and it’s Row Number 4.

Note that ROW and INDEX both work together to return the reference.

Try using the INDEX function separately. You will see Excel returns the cell value that lies on that position number instead of showing the row number.

Kasper Langmann, Microsoft Office Specialist

That’s how you can use the ROW function together with other functions. Now let’s see an example with the ROWS function.

We will use the same data set. But this time, we want a random result instead of a particular row number.

For this, we will use the INDEX function and the RANDBETWEEN function.

The formula looks something like this:

= INDEX(A1:A8, RANDBETWEEN (1, ROWS(A1:A8)))

Formula for using ROWS function
  • ROWS(A1:A8) – the ROWS function returns the number of cells between rows 1 to 8. The answer to this is 8.
  • RANDBETWEEN (1, ROWS(A1:A8)) – the RANDBETWEEN function will return a random number between 1 and 8 (the value returned by the ROWS function).
  • INDEX (A1:A8, RANDBETWEEN (1, ROWS (A1:A8)) – the INDEX function will return the value from range A1:A8 that lies on the position number returned by RANDBETWEEN.

Upon applying it, Excel returns a random result from the vertical array.

Choosing a random character.

Note that Ronald Weasley falls on number 2 in the list above. This means the RANDBETWEEN function returned the number 2.

And the INDEX function returned the value that falls in the second position in the range A2:A8.

See? That’s how easy it is to use the ROW and ROWS functions 🚀

That’s it – Now what?

In this article, we learned the use of the ROW and ROWS functions. We also saw how we could use these functions in formulas and in combination with other functions.

Both these functions are very helpful in filtering out data from thousands of rows. And when used together with other important functions of Excel – they can prove even more useful🥂

The three most important functions of Excel are the VLOOKUP, SUMIF, and the IF functions.

Enroll in my free 30-minute Email course today to learn these functions (and more!)

Other resources

Learn more about the INDEX and the MATCH function that can be super useful when used together with the ROW/ROWS functions.

If you liked this article on the Excel ROW function, we bet you will love to know about Excel Column Numbers too.

Kasper Langmann2023-02-23T15:14:16+00:00

Page load link

Содержание

  1. Automatically number rows
  2. What do you want to do?
  3. Fill a column with a series of numbers
  4. Use the ROW function to number rows
  5. Display or hide the fill handle
  6. How to Number Rows in Excel (In 8 Easy Ways)
  7. Example
  8. Using Fill Handle
  9. Using Fill Series Option
  10. Incrementing Previous Row Number by 1
  11. Using ROW Function
  12. Using COUNTA Function
  13. Using OFFSET Function
  14. Using SUBTOTAL Function
  15. Creating Calculated Column in Excel Table
  16. Subscribe and be a part of our 15,000+ member family!

Automatically number rows

Unlike other Microsoft 365 programs, Excel does not provide a button to number data automatically. But, you can easily add sequential numbers to rows of data by dragging the fill handle to fill a column with a series of numbers or by using the ROW function.

Tip: If you are looking for a more advanced auto-numbering system for your data, and Access is installed on your computer, you can import the Excel data to an Access database. In an Access database, you can create a field that automatically generates a unique number when you enter a new record in a table.

What do you want to do?

Fill a column with a series of numbers

Select the first cell in the range that you want to fill.

Type the starting value for the series.

Type a value in the next cell to establish a pattern.

Tip: For example, if you want the series 1, 2, 3, 4, 5. type 1 and 2 in the first two cells. If you want the series 2, 4, 6, 8. type 2 and 4.

Select the cells that contain the starting values.

Note: In Excel 2013 and later, the Quick Analysis button is displayed by default when you select more than one cell containing data. You can ignore the button to complete this procedure.

Drag the fill handle across the range that you want to fill.

Note: As you drag the fill handle across each cell, Excel displays a preview of the value. If you want a different pattern, drag the fill handle by holding down the right-click button, and then choose a pattern.

To fill in increasing order, drag down or to the right. To fill in decreasing order, drag up or to the left.

Tip: If you do not see the fill handle, you may have to display it first. For more information, see Display or hide the fill handle.

Note: These numbers are not automatically updated when you add, move, or remove rows. You can manually update the sequential numbering by selecting two numbers that are in the right sequence, and then dragging the fill handle to the end of the numbered range.

Use the ROW function to number rows

In the first cell of the range that you want to number, type =ROW(A1).

The ROW function returns the number of the row that you reference. For example, =ROW(A1) returns the number 1.

Drag the fill handle across the range that you want to fill.

Tip: If you do not see the fill handle, you may have to display it first. For more information, see Display or hide the fill handle.

These numbers are updated when you sort them with your data. The sequence may be interrupted if you add, move, or delete rows. You can manually update the numbering by selecting two numbers that are in the right sequence, and then dragging the fill handle to the end of the numbered range.

If you are using the ROW function, and you want the numbers to be inserted automatically as you add new rows of data, turn that range of data into an Excel table. All rows that are added at the end of the table are numbered in sequence. For more information, see Create or delete an Excel table in a worksheet.

To enter specific sequential number codes, such as purchase order numbers, you can use the ROW function together with the TEXT function. For example, to start a numbered list by using 000-001, you enter the formula =TEXT(ROW(A1),»000-000″) in the first cell of the range that you want to number, and then drag the fill handle to the end of the range.

Display or hide the fill handle

The fill handle displays by default, but you can turn it on or off.

In Excel 2010 and later, click the File tab, and then click Options.

In Excel 2007, click the Microsoft Office Button , and then click Excel Options.

In the Advanced category, under Editing options, select or clear the Enable fill handle and cell drag-and-drop check box to display or hide the fill handle.

Note: To help prevent replacing existing data when you drag the fill handle, ensure the Alert before overwriting cells check box is selected. If you do not want Excel to display a message about overwriting cells, you can clear this check box.

Источник

How to Number Rows in Excel (In 8 Easy Ways)

Numbering rows in Excel. Doesn’t sound like a tough feat, right? Don’t worry, it really isn’t. Why would you need to number rows? When handling any database, it can always do with organizing and the organizing may come in the form of alphabetical order, chronological order, or serial numbering depending on the type of data.

You’ll find yourself behind many such common tasks when handling data in Excel and not only would it serve best to expedite such tasks, it would also help to pick the most suitable method.

Today’s tutorial can help you with that. We are learning how to number rows in Excel and have a handful of techniques to achieve that. Quickly listing them down, we will number rows using the Fill Handle, Fill Series, simple addition, the ROW, COUNTA, OFFSET, and SUBTOTAL functions, and an Excel table. The anomalies you can face while numbering rows is gaps in the data and filtering data and this will be dealt with the COUNTA and SUBTOTAL functions respectively.

We can get started after seeing an example of what we’ll be working with.

Table of Contents

Example

You’ll most probably need to number rows in Excel for serial numbering in your dataset so here’s an example of where it can be applied:

We have an employee database of a school which can do with some sequential numbering. Our aim is to serially number this dataset in column B.

With some methods, you will get static numbering of rows and dynamic numbering with the rest. If that is important to you, we’ve mentioned which method delivers which results with the subheadings.

Let’s get numbering!

Using Fill Handle

Let’s use the simplest method first which requires no functions or fancy features. We use the Fill Handle. The Fill Handle is the tiny square that appears at the bottom-right corner of the selected cell(s). The Fill Handle recognizes the formula or pattern contained in the selected cell(s) and copies them down to the extended range. With this feature, we can number the rows in our dataset. See below how it’s done:

  • In the column where you want the serial numbers, enter 1 and 2 in the first and second rows:

  • This will help the Fill Handle pick up on the pattern.
  • Select these two cells containing the numbers 1 and 2. The Fill Handle will appear in the bottom corner.

  • Hover the cursor on the Fill Handle until the cursor changes to a cross.

  • Now click and drag the Fill Handle to where you want the numbered rows. We want the rows numbered to 10 so we’ll drag the handle down to B12. The callout bubble will display the value for the target cell as you click and drag.

If you want to number the entire dataset’s rows, double-click the Fill Handle and it will number all the rows of the dataset that have the adjacent column filled.

When you release the left mouse button, the cells will be auto-filled with the numbered rows using the Fill Handle:

Using Fill Series Option

Here’s another feature that acts as a filler. To fill the rows with serial numbers, you can give Fill Series a go. Given its few options, you’ll find it quite handy for filling in numbers and dates in the specified steps. For now, we only need sequential numbering so we’ll head onto the steps right away:

  • Enter the number 1 in the first row of the column you want numbered.
  • Select the cell so that Fill Series can create the series to fill the column based on this number.
  • Select the Fill icon in the Editing section of the Home tab and then select the Series option from the menu.

  • The Series dialog box will be launched.
  • In the dialog box make the following selections:
    • Select the Columns radio button in the Series in section
    • Select the Linear radio button in the Type
    • Enter the Step value and Stop value for your number series.
  • For us, that would be 1 and 10.
  • The Step value is the number by which you want the numbers to increase. E.g. if we enter 2 here, the numbers in the series would go 1, 3, 5….. Since we want regular numbering, we have entered 1 as the Step value.
  • Stop value is the number where you want the series to end.

  • Click on the OK button when done.

With these steps, the column will be filled with the given number series:

Incrementing Previous Row Number by 1

Now we move on to the formulas for numbering rows in Excel and it only makes sense to start with the simplest one first. By adding 1 to the previous row number, we can create a sequence of numbers. Here’s what you need to do if you choose this method:

  • Start by entering «1» in the first cell where the serial numbers will be.
  • In the next cell of the column, add 1 to the previous cell using this formula:

In this formula, B3 will be the cell containing the number 1. Adding 1 to B3 will result in the number 2. And this is how it will keep going. The next cell will be B4+1 which will result in 3, so on and so forth. In this way, the numbers will keep increasing serially.

  • Now extend the formula to where you want the last number.
  • With this plain arithmetic formula, the rows will be numbered up to 10:

Using ROW Function

And now we will number rows using a simple function, the ROW function. The ROW function returns the row number of a referred cell. So, no matter where we are on the active worksheet, if you refer a certain cell, the ROW function would return the specified cell’s row number. With the steps below, we’ll show you how we make the ROW function work for returning numbered rows:

The ROW function has been used on its own to return the number of the row the formula is entered in and then we deduct that figure by 2. Why? Our target cell is B3 so =ROW() would return 3. To make the ROW function return 1 as the first number, we have deducted 2 in the formula. You will need to adjust this value according to the row your target cell is in.

As the formula is copied down, it will return the row number and then 2 will be subtracted. E.g. in the next instance, the row number is 4. 4-2 = 2. The next row number will be 5. 5-2 = 3 and so on.

We have chosen this formula since our numbering was starting from B3. If you’re already starting from row 1, you can enter the formula as:

This formula will return the row number of the cell the formula is entered in.

Note: Both the ROW formulas suggested above will bring about dynamic results that recalculate with additions and deletions.

Using COUNTA Function

Going good up until now. Rows are being numbered, the morning birds are taking their cue and the sun is rising somewhere. And then you realize that as opposed to a continuous dataset, your data has some blank rows that don’t need numbering. Challenge accepted; we have the COUNTA function at our disposal.

The COUNTA function counts the number of cells in a range that are not empty. COUNTA will count the non-empty cells in the adjacent column and, with the IF and ISBLANK functions, will return nothing if the adjacent cell is blank. Sounds like a plan. Let’s see all the works. we begin with this formula:

As per the IF function, C3 will be checked by the ISBLANK function as to whether it’s a blank cell or not. If this tests true, the IF function will return an empty text string «».

If the cell is not blank, then the COUNTA function will start counting the non-blank cells from $C$3 (mentioning the number as an absolute reference locks the cell in the formula so that as the formula is copied down, the reference remains the same) and return the count as the answer of the formula.

In the first instance, the count from C3 only makes 1 cell so 1 is the result.

In the next instance, COUNT counts C3 and C4 and therefore returns 2. In the third instance, the adjacent cell i.e. C5 is blank so this row has not been numbered.

Note: The results of using this formula are dynamic; with any change of addition or deletion of data, the numbering will recalculate and adjust accordingly.

Using OFFSET Function

Rows in Excel can also be numbered using the OFFSET function. It’s a slightly “off” the norm method but a method nonetheless and it requires you to start the column without a header; you’ll see why in a while.

The OFFSET function returns the value of the cell which is the given numbers of rows and columns from the specified cell. We will use this concept to then add 1 to each result to create serial numbering. Below is the demonstration with the formula:

Now you’ll see why a blank column header was a prerequisite. Let’s understand the path in the formula. The cell specified is B3 itself. From there, OFFSET trails to -1 rows. This means B2. now in the third parameter of the formula, from B2 we need to shift to 0 columns which still leads to B2.

This means that using the OFFSET function, we will be referring to the previous cell in the same column. In the last bit of the formula, we have +1 which adds the number 1 to the value of B2. Since B2 is blank, 0+1 = 1. 1 is the outcome here. This is why we needed the header to be blank.

In the next instance, OFFSET will lead to B3 and add 1 to B3’s value. 1+1 = 2. That is how the rest of the rows will be numbered in succession.

Once you are done, you can copy and paste the values over themselves and add the column header if you so wish. The values are pasted back so that they are not formula-reliant and won’t cause errors.

Note: As long as the column header is absent, the results of this formula are dynamic. If you wish to add the column header, you will have to paste back the values or you can choose another method if want to retain the column header and the dynamic numbering.

Using SUBTOTAL Function

And again, things were looking bright until you were hit with another requirement. You need to filter data but that would also filter the serial numbers. Now that’s a problem but not a problem we can’t work around. Enter SUBTOTAL function.

The SUBTOTAL function returns a subtotal in a dataset. While we will be using the COUNTA function via SUBTOTAL, SUBTOTAL will help to dynamically recalculate the row numbers as the data is filtered. Want to see how that works? We’ve got the formula to number rows with the SUBTOTAL function right ahead:

The SUBTOTAL function presents a list of functions to choose from in the Formula AutoComplete. This parameter will determine what kind of subtotal you want to enter.

After selecting the function, the next input is the cell reference. As shown in the COUNTA function section above, we will enter $C$3:C3 as the range so that the count always begins from $C$3. As the formula is filled downward, the count will continue up until the target cell.

Now try filtering your data.

The row numbers will be recalculated with the filtered data serially numbered:

With the new serial number selected, we can note in the formula that the count for non-blank cells has started from $C$3 to C4 instead of C3. In this way, the count will begin from $C$3 and jump directly to the first filtered cell in the C column.

Creating Calculated Column in Excel Table

Last but not least, let’s table it! An Excel table talks the talk and walks the walk and there are many convenient features it offers. The one helping us today is a calculated column; enter one formula and you’ll have numbered rows. Excel tables are known for being dynamic in their very nature and a calculated column also provides that ease. Nothing short of Excel magic. The complete tricks (read steps) to do this are as follows:

  • Select any cell in the dataset. This will help Excel identify the range to create the Excel table.
  • In the Home tab, go to the Styles section and click on the Format as a Table Select the table style from the menu or create your own.

  • Now a small dialog box will appear confirming the identified range of the intended Excel table. Correct the range if required.
  • If your table has headers, leave the My table has headers checkbox checked.
  • Then click on the OK button to close the dialog box and apply the table.

  • An Excel table will be created on the provided range:

  • Now, enter this formula in any cell in the column where you want the numbers:

As a calculated column, when the formula is entered, all the rows will automatically be serially numbered:

And that’s your job done!

And that’s our tutorial done! The solutions may be numbered but so are the problems and today you saw how to tackle numbering rows in Excel in many different ways.

Filtering data and dealing with gaps in the data are two hitches you might face when numbering rows but today you’ve learned how to breeze through them. We’re up for making other hitches easy, breezy and we’re on it too so we’ll see you around another Excel trick!

Subscribe and be a part of our 15,000+ member family!

Now subscribe to Excel Trick and get a free copy of our ebook «200+ Excel Shortcuts» (printable format) to catapult your productivity.

Источник

Понравилась статья? Поделить с друзьями:
  • Excel this cell row
  • Excel therapy oxygenate cream
  • Excel therapy o2 pollution defense youthfulness activating oxygenating cream
  • Excel set the value of a cell
  • Excel set range to named range