Excel cell reference from cell

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

A cell reference refers to a cell or a range of cells on a worksheet and can be used in a formula so that Microsoft Office Excel can find the values or data that you want that formula to calculate.

In one or several formulas, you can use a cell reference to refer to:

  • Data from one or more contiguous cells on the worksheet.

  • Data contained in different areas of a worksheet.

  • Data on other worksheets in the same workbook.

For example:

This formula:

Refers to:

And Returns:

=C2

Cell C2

The value in cell C2.

=A1:F4

Cells A1 through F4

The values in all cells, but you must press Ctrl+Shift+Enter after you type in your formula.

Note: This functionality doesn’t work in Excel for the web.

=Asset-Liability

The cells named Asset and Liability

The value in the cell named Liability subtracted from the value in the cell named Asset.

{=Week1+Week2}

The cell ranges named Week1 and Week2

The sum of the values of the cell ranges named Week1 and Week 2 as an array formula.

=Sheet2!B2

Cell B2 on Sheet2

The value in cell B2 on Sheet2.

  1. Click the cell in which you want to enter the formula.

  2. In the formula bar Button image, type = (equal sign).

  3. Do one of the following:

    • Reference one or more cells    To create a reference, select a cell or range of cells on the same worksheet.

      You can drag the border of the cell selection to move the selection, or drag the corner of the border to expand the selection.

    • Reference a defined name    To create a reference to a defined name, do one of the following:

      • Type the name.

      • Press F3, select the name in the Paste name box, and then click OK.

        Note: If there is no square corner on a color-coded border, the reference is to a named range.

  4. Do one of the following:

    • If you are creating a reference in a single cell, press Enter.

    • If you are creating a reference in an array formula (such A1:G4), press Ctrl+Shift+Enter.

      The reference can be a single cell or a range of cells, and the array formula can be one that calculates single or multiple results.

      Note: If you have a current version of Microsoft 365, then you can simply enter the formula in the top-left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

You can refer to cells that are on other worksheets in the same workbook by prepending the name of the worksheet followed by an exclamation point (!) to the start of the cell reference. In the following example, the worksheet function named AVERAGE calculates the average value for the range B1:B10 on the worksheet named Marketing in the same workbook.

Sheet reference example

1. Refers to the worksheet named Marketing

2. Refers to the range of cells between B1 and B10, inclusively

3. Separates the worksheet reference from the cell range reference

  1. Click the cell in which you want to enter the formula.

  2. In the formula bar Button image, type = (equal sign) and the formula you want to use.

  3. Click the tab for the worksheet to be referenced.

  4. Select the cell or range of cells to be referenced.

Note: If the name of the other worksheet contains nonalphabetical characters, you must enclose the name (or the path) within single quotation marks ().

Alternatively, you can copy and paste a cell reference and then use the Link Cells command to create a cell reference. You can use this command to:

  • Easily display important information in a more prominent position. Let’s say that you have a workbook that contains many worksheets, and on each worksheet is a cell that displays summary information about the other cells on that worksheet. To make these summary cells more prominent, you can create a cell reference to them on the first worksheet of the workbook, which enables you to see summary information about the whole workbook on the first worksheet.

  • Make it easier to create cell references between worksheets and workbooks. The Link Cells command automatically pastes the correct syntax for you.

  1. Click the cell that contains the data you want to link to.

  2. Press Ctrl+C, or go to the Home tab, and in the Clipboard group, click Copy Button image.

    Clipboard group on the Home tab

  3. Press Ctrl+V, or go to the Home tab, in the Clipboard group, click Paste Button image.

    By default, the Paste Options Button image button appears when you paste copied data.

  4. Click the Paste Options button, and then click Paste Link Button image.

  1. Double-click the cell that contains the formula that you want to change. Excel highlights each cell or range of cells referenced by the formula with a different color.

  2. Do one of the following:

    • To move a cell or range reference to a different cell or range, drag the color-coded border of the cell or range to the new cell or range.

    • To include more or fewer cells in a reference, drag a corner of the border.

    • In the formula bar Button image, select the reference in the formula, and then type a new reference.

    • Press F3, select the name in the Paste name box, and then click OK.

  3. Press Enter, or, for an array formula, press Ctrl+Shift+Enter.

    Note: If you have a current version of Microsoft 365, then you can simply enter the formula in the top-left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

Frequently, if you define a name to a cell reference after you enter a cell reference in a formula, you may want to update the existing cell references to the defined names.

  1. Do one of the following:

    • Select the range of cells that contains formulas in which you want to replace cell references with defined names.

    • Select a single, empty cell to change the references to names in all formulas on the worksheet.

  2. On the Formulas tab, in the Defined Names group, click the arrow next to Define Name, and then click Apply Names.

    Defined Names group on the Formulas tab

  3. In the Apply names box, click one or more names, and then click OK.

  1. Select the cell that contains the formula.

  2. In the formula bar Button image, select the reference that you want to change.

  3. Press F4 to switch between the reference types.

For more information about the different type of cell references, see Overview of formulas.

  1. Click the cell in which you want to enter the formula.

  2. In the formula bar Button image, type = (equal sign).

  3. Select a cell or range of cells on the same worksheet. You can drag the border of the cell selection to move the selection, or drag the corner of the border to expand the selection.

  4. Do one of the following:

    • If you are creating a reference in a single cell, press Enter.

    • If you are creating a reference in an array formula (such A1:G4), press Ctrl+Shift+Enter.

      The reference can be a single cell or a range of cells, and the array formula can be one that calculates single or multiple results.

      Note: If you have a current version of Microsoft 365, then you can simply enter the formula in the top-left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

You can refer to cells that are on other worksheets in the same workbook by prepending the name of the worksheet followed by an exclamation point (!) to the start of the cell reference. In the following example, the worksheet function named AVERAGE calculates the average value for the range B1:B10 on the worksheet named Marketing in the same workbook.

Sheet reference example

1. Refers to the worksheet named Marketing

2. Refers to the range of cells between B1 and B10, inclusively

3. Separates the worksheet reference from the cell range reference

  1. Click the cell in which you want to enter the formula.

  2. In the formula bar Button image, type = (equal sign) and the formula you want to use.

  3. Click the tab for the worksheet to be referenced.

  4. Select the cell or range of cells to be referenced.

Note: If the name of the other worksheet contains nonalphabetical characters, you must enclose the name (or the path) within single quotation marks ().

  1. Double-click the cell that contains the formula that you want to change. Excel highlights each cell or range of cells referenced by the formula with a different color.

  2. Do one of the following:

    • To move a cell or range reference to a different cell or range, drag the color-coded border of the cell or range to the new cell or range.

    • To include more or fewer cells in a reference, drag a corner of the border.

    • In the formula bar Button image, select the reference in the formula, and then type a new reference.

  3. Press Enter, or, for an array formula, press Ctrl+Shift+Enter.

    Note: If you have a current version of Microsoft 365, then you can simply enter the formula in the top-left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula. Otherwise, the formula must be entered as a legacy array formula by first selecting the output range, entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more information on array formulas, see Guidelines and examples of array formulas.

  1. Select the cell that contains the formula.

  2. In the formula bar Button image, select the reference that you want to change.

  3. Press F4 to switch between the reference types.

For more information about the different type of cell references, see Overview of formulas.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Need more help?

There are many ways to achieve this. Here is one way. I have extended the function by incorporating the rows and columns that you want to Offset. Paste this code in a module

Syntax

=GetOffset(Range,Row,Col)

Remarks

Range (Required) is the cell which has the formula

Row (Optional) Row(s) you want to offset

Col (Optional) Column(s) you want to offset

Sample Usage

=GetOffset(A1) : This will pickup the value from the same cell which A1 is referring to. If A1 is referring to =data!C69 then GetOffset will get value from data!C69

=GetOffset(A1,1) : This will pickup the value from the next cell (1 row down) which A1 is referring to. If A1 is referring to =data!C69 then GetOffset will get value from data!C70

=GetOffset(A1,1,1) : This will pickup the value from the next cell (1 row down across 1 Col) which A1 is referring to. If A1 is referring to =data!C69 then GetOffset will get value from data!D70

=GetOffset(A1,0,1) : This will pickup the value from the next cell (Same row across 1 Col) which A1 is referring to. If A1 is referring to =data!C69 then GetOffset will get value from data!D69

CODE

Public Function GetOffset(Rng As Range, Rw As Long, Col As Long) As Variant
    Dim MyArray() As String, strTemp As String
    Dim TempRow As Long, TempCol As Long

    On Error GoTo Whoa

    Application.Volatile

    MyArray = Split(Rng.Formula, "!")

    TempRow = Range(MyArray(UBound(MyArray))).Row
    TempCol = Range(MyArray(UBound(MyArray))).Column

    TempRow = TempRow + Rw
    TempCol = TempCol + Col

    strTemp = MyArray(0) & "!" & Cells(TempRow, TempCol).Address

    GetOffset = Application.Evaluate(Trim(strTemp))
    Exit Function
Whoa:
End Function

Microsoft Excel, sometimes known as MS Excel, is a potent spreadsheet programme. In Excel, each worksheet consists of a number of cells that are made up of rows and columns. Each cell has a unique reference, which enables users to quickly access and address the required cell (or cells) within the functions. In Excel, cell references are crucial, particularly when working with huge data sets in functions and formulas.

This article covers a quick overview of Excel Cell References. The various sorts of cell references that Excel offers and the detailed instructions for using each one are also covered in the article.

What is a Cell Reference?

An Excel cell reference, also known as a cell address, is a mechanism that defines a cell on a worksheet by combining a column letter and a row number. We can refer to any cell (in Excel formulas) in the worksheet by using the cell references.

For example:

Cell Reference Excel

Here we refer to the cell in column A & row 2 by A2 & cell in column A & row 5 by A5. You can make use of such notations in any of the formulas or copy the value of one cell to another cell (by using = A2 or = A5).

Types of Cell Reference in Excel

Understanding various cell references primarily makes it easier for us to use Excel formulas and avoid unexpected formula errors. When copying and pasting Excel formulas, this is quite useful. Based on various use situations, Excel offers three main types of cell references, including:

  • Relative Cell Reference
  • Absolute Cell Reference
  • Mixed Cell Reference

1. Relative Cell Reference 

In Excel, a relative cell reference is used by default. Excel uses a relative reference whenever we insert a cell reference or a range within a formula. The relative references, which commonly reflect the combination of column name and row number, are used normally with the associated cell references. There is no dollar ($) sign in the relative reference for the cell. 

How to Use Relative Cell References in Excel

Let’s see how to use the Relative Cell references through examples,

#Example 1: 

If you refer to cell B1 from cell E1, actually you would be referring to a cell that is 3 columns to the left (E-B = 3) within the same row number 1. 

When it is copied to other locations present in a worksheet, the relative reference for that location will be changed automatically. (because relative cell reference describes offset to another cell rather than a fixed address as In our example, offset is : 3 columns left in the same row).

Relative Cell References in Excel

#Example 2: 

If you copy the formula = C2 / A2 from the cell “E2” to “E3”, the formula in E3 will automatically become =C3/A3.

relative reference excel formula

When to Use Relative Cell References in Excel

When you need to develop a formula for a set of cells and the formula needs to make a reference to a relative cell reference, relative cell references come in handy.

When this occurs, you can create the formula in one cell and copy it before pasting it into every other cell.

2. Absolute Cell Reference 

When copying or using AutoFill, there are times when the cell reference must stay the same. A column and/or row reference is kept constant using dollar signs. So, to get an absolute reference from a relative, we can use the dollar sign ($) characters.

To refer to an actual fixed location on a worksheet whenever copying is done, we use absolute reference. The reference here is locked such that rows and columns do not shift when copied. 

How to Use Absolute Cell References in Excel

Below is an example depicting how to use Absolute Cell References in Excel.

#Example: 

When we fix both row & column – Say if we want to lock row 2 & column A, we will use $A$2 as:

G2 = C2/$A$2, when copied to G3, G3 becomes = C3/$A$2

 Note: C3 is 4 columns left to G3 in the same row.

Absolute Cell References in Excel

Here, original cell reference A2 is maintained whenever we copy G2 to any of the cells. So I3 = E3/$A$2 because E3 comes from the relative reference (4 columns left to the current one) & /$A$2 comes from the absolute reference.

Therefore, I3 = E3//$A$2 = 12/10 = 1.2

What Does the Dollar ($) Sign Do?

When the row and column numbers are preceded by the dollar symbol ($), it becomes absolute (i.e., stops the row and column number from changing when copied to other cells). Dollar ($) before the row fixes the row & before the column fixes the column.

When to Use Absolute Cell References in Excel

When you don’t want the cell reference to alter when you replicate formulas, absolute cell references come in handy. This can be the situation if you have to use a fixed value in the formula.

3. Mixed Cell Reference 

An absolute column and relative row, or an absolute row and relative column, is a mixed cell reference. You get an absolute column or absolute row when you individually put the $ before the column letter or before the row number. Example: $B8 is relative to row 8 but absolute for column B, and B$8 is absolute for row 1 but relative for column A.

Here, the Dollar ($) before the row number fixes/locks the row & before the column name fixes/locks the column.

#Example: 

When we fix the only row: If we have G2 = C2/A$2 then :

We used $ before the row number, so we are locking the only row here. When G2 is copied to G3, G3 = C3/A$2 (not C3/A3) because the row has been fixed already.

Mixed Cell Reference

Here, whenever we copy G2 to any other cell, always the divisor will refer to a fixed row 2 (column vary according to the concept of relative reference)

So, when G2 is copied to I3, I3 = E3/C$2 because E3 comes from the relative reference (4 columns left to the current one) & C$2 comes from the absolute reference for row & relative reference for Column (6 Columns left to the current one)

Some Other Ways of Using Cell References With Examples

Now that we are familiar with the basics of using Cell References in Excel, let’s see some other ways of using cell references.

Relative and Absolute Cell References for Calculating Dates 

We can use relative and absolute cell references to calculate dates.

Example: To Calculate the Date of Delivery online from the given date of the order placed & no of days it will take to deliver :

Relative and absolute cell references for calculating dates

Here, We calculate the Date of Delivery by = Order Date + No of days to deliver. We used Relative cell reference so that individual product delivery dates can be calculated.

Absolute cell references for calculating dates :

Example: To Calculate the Date of Birth When the age is known is a number of days using Current date can be done by making use of absolute reference. 

Relative and Absolute Cell References

Here, We calculate DOB by = Current Date – Age in days. The Current date is contained in the cell E2 & in subtraction, we fixed that date to subtract from the days.

Whole Column Reference 

You will want to refer to all the cells inside a particular column when operating with an Excel worksheet with any number of rows. Simply type a column letter twice with a colon in between to refer to the entire column B, for example, B:B.

Example: You may want to find the sum of a column of data in certain cases. While you can do this with a regular cell range, such as =SUM(B1:B10), you will need to change the cell range if your spreadsheet grows in size.

Excel, on the other hand, has a cell range that does not require the row number and takes all the cells in the column in action. If you wanted to find the sum of all the values in column B, for example, you would type =SUM (B:B). You can add as much data as you want to your spreadsheet without having to change your cell ranges if you use this type of cell range.

Whole Column Reference

Whole Row Reference 

You will want to refer to all the cells inside a particular row when operating with an Excel worksheet with any number of columns. Simply type a row number twice with a colon in between to refer to the entire row, for example, 2:2.

Example: You may want to find the sum of a row of data in certain cases. While you can do this with a regular cell range, such as =SUM(A2 : J2), you will need to change the cell range if your spreadsheet grows in size.

Excel, on the other hand, has a cell range that does not require the column letter and takes all the cells in the row in action. If you wanted to find the sum of all the values in row 2, for example, you would type =SUM (2:2). You can add as much data as you want to your spreadsheet without having to change your cell ranges if you use this type of cell range.

Whole Row Reference

Refer to an Entire Column, Excluding the First Few Rows 

To refer to the entire column excluding the first few rows, you need to specify the range as we give in a normal fashion. We know that the Excel worksheets can have only 1,048,576 rows. (To check this, go to an empty cell & press: Ctrl + Down arrow Key)

So, we can do the sum of the entire column B except for the first 5 rows by = SUM(B6:B1048576).

Refer to an Entire Column Excluding the First Few Rows

Using a Mixed Entire Column Reference in Excel 

You can also create a mixed entire-column reference, say for example $B:B. But, practically, it is difficult to find a situation where it would be used.

Example :

Mixed Entire Column Reference in Excel

How to switch between Absolute, Relative, and Mixed References

The $ sign can be manually typed in an Excel formula to adjust a relative cell relation to absolute or mixed. You can also speed things up by pressing the F4 key. You must be in formula edit mode to use the F4 shortcut. The steps are :
Firstly, choose the cell that contains the formula. Then, by pressing the F2 key or double-clicking the cell, you can enter Edit mode. Select the cell reference in which you want to make changes. Then, switch between four-cell reference forms by pressing F4.

Example: When you select a cell having only relative reference (i.e., no $ sign), say = B2:

  • The first time when you press F4, it becomes =$B$2
  • The second time when you press F4, it becomes =B$2
  • The third time when you press F4, it becomes=$B2
  • The fourth time when you press F4, it becomes back to the relative reference=B2

B2 –Press F4–> =$B$2  –Press F4–> =B$2 –Press F4–> = =$B2  –Press F4–> =B2

So, using F4, you do not require to manually type the $ symbol.

Important Points to Remember

  • One of the crucial components for Excel functions or formulas is the cell reference.
  • Excel formulas that employ relative cell references automatically change the references to match the correct row and column.
  • When copying formulas into non-relative cells, absolute cell references are advised. Excel keeps the absolute cell references constant.
  • According to the specifications, a mixed reference only locks one of the references, either the row or the column. Not both are locked.

FAQs on Excel Cell References 

1. What are the 3 types of cell references in Excel?

Ans: In Excel, we can use one of three types of cell references:

  • Relative Cell References
  • Absolute Cell References
  • Mixed Cell References

Понравилась статья? Поделить с друзьями:
  • Excel cell numbering format
  • Excel cell not linking
  • Excel cell not formatting number
  • Excel cell no scroll
  • Excel cell have value