Excel calculate from sheet to sheet

Содержание

  1. Excel: Use a complex model to calculate values on another sheet [closed]
  2. 2 Answers 2
  3. Examples of using the SHEET and SHEETS functions in Excel formulas
  4. SHEET and SHEETS functions in Excel: description of arguments and syntax
  5. How to get sheet name by formula in Excel
  6. Examples of using the SHEET function and SHEETS
  7. Processing information about the sheets of the book on the formula Excel
  8. Microsoft Excel — Formula to Calculate Sum of Cells in Separate Worksheets
  9. Example using Sheet1 and Sheet2
  10. How to Sum Across Multiple Sheets in Microsoft Excel
  11. How to use INDIRECT function in Excel — formula examples
  12. Excel INDIRECT function — syntax and basic uses
  13. INDIRECT function syntax
  14. Basic use of the INDIRECT function
  15. How to use INDIRECT in Excel — formula examples
  16. Creating indirect references from cell values
  17. Creating indirect references from cell values and text
  18. Using the INDIRECT function with named ranges
  19. INDIRECT formula to dynamically refer to another worksheet
  20. Creating an Excel dynamic reference to another workbook
  21. Using Excel INDIRECT function to lock a cell reference
  22. Using INDIRECT with other Excel functions
  23. Example 1. INDIRECT and ROW functions
  24. Example 2. INDIRECT and ADDRESS functions
  25. Using INDIRECT with Data Validation in Excel
  26. Excel INDIRECT function — possible errors and issues
  27. Excel INDIRECT #REF! error
  28. Excel INDIRECT #NAME? error
  29. Using the INDIRECT function in non-English locales
  30. You may also be interested in

Excel: Use a complex model to calculate values on another sheet [closed]

Want to improve this question? Update the question so it’s on-topic for Stack Overflow.

Closed 10 years ago .

Let’s say I created a complex financial model that uses 20 variable inputs to ultimately come up with a single result through a very large series of cells and formulas. I then want to make a summary rollup sheet that provides 7 or so sets of the 20 variables and the result value for each combination, but be able to tweak them and get the new result re-calculated. How can I have the model sheet be used as a calculation for the rollup sheet with 20 variables being passed?

For example, Model:

2 Answers 2

You can achieve this with Excel’s built in data tables!

Data tables take a a table with either one or two variable in the header row/column — and calculate the result of the workbook for each combination. Here is a simple model to show the concept:

To get this to work you need to:

  1. Place a link to the final result your interested in into the top left cell of this table (in this case I place =B3 in cell A5).
  2. Enter the options for parameters 1 and 2 in the header row/column
  3. Select the table
  4. Click Data tab->Data Tools->What-If-Analysis->Data Table
  5. Link the two parameters

Now in your case you have 20 parameters that you want to modify. You can easily do this the following way:

Источник

Examples of using the SHEET and SHEETS functions in Excel formulas

SHEET function in Excel returns a numeric value corresponding to the sheet number referenced by the link passed to the function as a parameter.

SHEET and SHEETS functions in Excel: description of arguments and syntax

SHEETS function in Excel returns a numeric value that corresponds to the number of sheets referenced.

  1. Both functions are useful for use in documents containing a large number of sheets.
  2. A sheet in Excel is a table of all the cells that are displayed on the screen and are outside of it (a total of 1,048,576 rows and 16,384 columns). When sending a sheet to print, it can be divided into several pages. Therefore, the terms “sheet” and “page” should not be confused.
  3. The number of sheets in the book is limited only by the amount of PC RAM.

Function has only 1 argument in its syntax and is optional for: =SHEET( value ).

  • value is an optional function argument that contains text data with the name of the sheet or a link for which you want to set the sheet number. If this parameter is not specified, the function will return the number of the sheet in one of the cells of which it was written.
  1. When the sheet works, all sheets that are visible, hidden and very hidden are taken into account. Exceptions are dialogs, macros, and diagrams.
  2. If the function argument is a text value that does not match the name of any of the sheets contained in the book, the error #NA will be returned.
  3. If an invalid value was passed as an argument to the function, the result of its calculation will be the error #REF!.
  4. Within the object model (the hierarchy of objects in VBA, in which Application is the main object and Workbook, WorkSheet, etc., are child objects), the SHEET function is not available because it contains a similar function.

The function has the following syntax: =SHEETS( reference ).

  • reference — an object of reference type for which you want to determine the number of sheets. This argument is optional. If this parameter is not specified, the function will return the number of sheets contained in the book where it was written.
  1. This function counts the number of all hidden, very hidden and visible sheets, with the exception of charts, macros and dialogs.
  2. If an invalid reference was passed as a parameter, the result of the calculation is the error code #REF!.
  3. This function is not available in the object model due to the presence of a similar function there.

How to get sheet name by formula in Excel

Example 1. In carrying out the calculated work the student used the Excel program, in which he created a book of several sheets. For his own convenience, the student decided to display in the cells A2 and B2 of each sheet data on the name of the sheet and its serial number, respectively. For this, he used the following formulas:

Description of arguments for the MID function:

  1. =CELL(«filename») is a function that returns text in which the MID function searches for a specified number of characters. In this case, the value “C:UserssoulpDesktop[Workbook.xlsx] Static_Calculations” will return, where after the “]” symbol is the required text — the name.
  2. =FIND(«]»,CELL(«filename»))+1 is a function that returns the position number of the character «]», one is added so that the MID function does not take into account the character].
  3. 31 — the maximum number of characters in the name.

=SHEET() — this function without parameter returns the number of the current sheet. As a result of its calculation, we get the number of sheets in the current book.

Examples of using the SHEET function and SHEETS

Example 2. The Excel workbook contains several sheets. It is necessary:

  1. Return the current sheet number.
  2. Return the sheet number with the name «Static_calculations».
  3. Return the number of the sheet «Dynamic_calculations», if its cell A3 contains the value 0.

Enter the data in the table:

Next, we write the formulas for all 4 conditions:

  • For condition # 1, use the following formula: =SHEET()
  • For condition # 2, enter the formula: =SHEET(«Static_calculations»)
  • For condition number 3 we write the formula:

0″)’ >

The IF function checks whether the value stored in the A3 cell of the Dynamic_ calculations is equal to zero or null.

As a result, we get:

Processing information about the sheets of the book on the formula Excel

Example 3. To determine the contains several sheets. It is necessary to determine the total number of sheets, as well as the number contained between the “Static_calculations” and “Economic_calculations”.

The source table is:

The total number of sheets is calculated by the formula:

To determine the number contained between these two sheets, we write the formula:

  1. Static_calculations: Economic_calculations!A2 — A reference to cell A2 of the range of sheets between «Static_calculations» and «Economic_calculations» including these sheets.
  2. To get the desired value, 2 was subtracted.

As a result, we get the following:

The formula displays detailed information on the data on the sheets in a certain range of their location in the Excel workbook.

Источник

Microsoft Excel — Formula to Calculate Sum of Cells in Separate Worksheets

This document explains how to calculate the sum or total when working with cell data located in multiple worksheets. In other words, how to take the value of a cell located in one worksheet and add it to the value of another cell located in another worksheet to come up with the total of the respective cells.

Example using Sheet1 and Sheet2

  1. Sheet1 has the following table setup.

Wisconsin Badgers Football

Year Wins Losses
2013 9 3
2012 8 4
2011 10 2
2010 11 1
2009 9 3
2008 7 5

Sheet2 has the following table setup.

Wisconsin Badgers Football

Year Wins Losses
2017 9 3
2006 11 1
2005 9 3
2004 10 2
2003 7 5
2002 7 6
Wins Losses
Total

Click into the desired cell you wish to add contents and type =SUM( and then the cell range you wish to add. In our example we chose the cell range =SUM(C3:C8).

Note: You are able to add multiple cell ranges by separating them by commas such as(B3:B8, C3:C8).

To add a cell range from a different sheet, simply insert the sheet name with an ! at the end followed by the cell range. In our example we added a range from Sheet2 to Sheet1 with the following function: =SUM(B3:B8, Sheet1!B3:B8)

After inserting the desired ranges hit enter and the cell will fill with the function results.

Источник

How to Sum Across Multiple Sheets in Microsoft Excel

In this article, we will learn how to get the sum or add cells across multiple sheets in Microsoft Excel.

Sometimes we need to access different values from different worksheets of the same excel book. Here we are accessing it to add multiple cells in Excel 2016.

In this article, we will learn how to sum the values located on different sheets in excel 2016. We will use the SUM function to add numbers.
SUM function adds up the values.
SUM = number 1 + number 2 + …
Syntax:

=SUM(number 1, number 2, ..)

Let’s understand how to add cells in excel 2016 with the example explained here.

These are numbers from three different sheets and desired output sum will be in Sheet 1.

Now we use the SUM function

=SUM(D6:D8, Sheet2!C3:C5,Sheet3!C5:C7)

Explanation:
The resulting output is in Sheet 1.
D6:D8 adds the values of Sheet 1 D6+D7+D8
C3:C5 adds the values of Sheet 2 C3+C4+C5
C5:C7 adds the values of Sheet 3 C5+C6+C7.
It’s basically the addition of values in cells
D6+D7+D8 + C3+C4+C5 + C5+C6+C7

You can select the cells separated by commas to add the numbers.

Your formula will look like the above image.

Press Enter and your desired sum will be here in Sheet 1.

As we can see Sum function returns the sum. You can use Autosum option in Home tab in Editing.

Click arrow key for more options like shown below.

Then select the cells to add up values in Excel. You can sum across the rows and columns using the SUM function.

Hope you got SUM function adding cells in excel. The same function can be performed in Excel 2016, 2013 and 2010. Let us know how you like this article. You will find more content on functions and formulas here. Please state your query down in the comment box. We will help you.

Источник

How to use INDIRECT function in Excel — formula examples

by Svetlana Cheusheva, updated on December 6, 2022

This Excel INDIRECT tutorial explains the function’s syntax, basic uses and provides a number of formula examples that demonstrate how to use INDIRECT in Excel.

A great lot of functions exist in Microsoft Excel, some being easy-to-understand, other requiring a long learning curve, and the former being used more often than the latter. And yet, Excel INDIRECT is one of the kind. This Excel function does not perform any calculations, nor does it evaluate any conditions or logical tests.

Well then, what is the INDIRECT function in Excel and what do I use it for? This is a very good question and hopefully you will get a comprehensive answer in a few minutes when you’ve finished reading this tutorial.

Excel INDIRECT function — syntax and basic uses

As its name suggests, Excel INDIRECT is used to indirectly reference cells, ranges, other sheets or workbooks. In other words, the INDIRECT function lets you create a dynamic cell or range reference instead of hard-coding them. As a result, you can change a reference within a formula without changing the formula itself. Moreover, these indirect references won’t change when some new rows or columns are inserted in the worksheet or when you delete any existing ones.

All this may be easier to understand from an example. However, to be able to write a formula, even the simplest one, you need to know the function’s arguments, right? So, let’s have a quick look at Excel INDIRECT syntax first.

INDIRECT function syntax

The INDIRECT function in Excel returns a cell reference from a text string. It has two arguments, the first is required and the second is optional:

ref_text — is a cell reference, or a reference to a cell in the form of a text string, or a named range.

a1 — is a logical value that specifies what type of reference is contained in the ref_text argument:

  • If TRUE or omitted, ref_text is interpreted as an A1-style cell reference.
  • If FALSE, ref_text is treated as a R1C1 reference.

While the R1C1 reference type might be useful in certain situations, you’ll probably want to use the familiar A1 references most of the time. Anyway, nearly all INDIRECT formulas in this tutorial will use A1 references, so we will be omitting the second argument.

Basic use of the INDIRECT function

To get into the function’s insight, let’s write a simple formula that demonstrates how you use INDIRECT in Excel.

Suppose, you have number 3 in cell A1, and text A1 in cell C1. Now, put the formula =INDIRECT(C1) in any other cell and see what happens:

  • The INDIRECT function refers to the value in cell C1, which is A1.
  • The function is routed to cell A1 where it picks the value to return, which is number 3.

So, what the INDIRECT function actually does in this example is converting a text string into a cell reference.

If you think this still has very little practical sense, please bear with me and I will show you some more formulas that reveal the real power of the Excel INDIRECT function.

How to use INDIRECT in Excel — formula examples

As demonstrated in the above example, you can use the Excel INDIRECT function to put the address of one cell into another as a usual text string, and get the value of the 1 st cell by referencing the 2 nd . However, that trivial example is no more than a hint at the INDIRECT capabilities.

When working with real data, the INDIRECT function can turn any text string into a reference including very complex strings that you build using the values of other cells and results returned by other Excel formulas. But let’s not put the cart before the horse, and run through several Excel Indirect formulas, one at a time.

Creating indirect references from cell values

As you remember, the Excel INDIRECT function allows for A1 and R1C1 reference styles. Usually, you cannot use both styles in a single sheet at a time, you can only switch between the two reference types via File > Options > Formulas > R1C1 check box. This is the reason why Excel users rarely consider using R1C1 as an alternative referencing approach.

In an INDIRECT formula, you can use either reference type on the same sheet if you want to. Before we move any further, you may want to know the difference between A1 and R1C1 reference styles.

A1 style is the usual reference type in Excel that refers to a column followed by a row number. For example, B2 refers to the cell at the intersection of column B and row 2.

R1C1 style is the opposite reference type — rows followed by columns, which does take some time getting used to : ) For example, R4C1 refers to cell A4 which is in row 4, column 1 in a sheet. If no number comes after the letter, then you are referring to the same row or column.

And now, let’s see how the INDIRECT function handles A1 and R1C1 references:

As you see in the screenshot above, three different Indirect formulas return the same result. Have you already figured out why? I bet you have : )

  • Formula in cell D1: =INDIRECT(C1)

This is the easiest one. The formula refers to cell C1, fetches its value — text string A2, converts it into a cell reference, heads over to cell A2 and returns its value, which is 222.

  • Formula in cell D3: =INDIRECT(C3,FALSE)

FALSE in the 2 nd argument indicates that the referred value (C3) should be treated like a R1C1 cell reference, i.e. a row number followed by a column number. Therefore, our INDIRECT formula interprets the value in cell C3 (R2C1) as a reference to the cell at the conjunction of row 2 and column 1, which is cell A2.

Creating indirect references from cell values and text

Similarly to how we created references from cell values, you can combine a text string and a cell reference within your INDIRECT formula, tied together with the concatenation operator (&).

In the following example, the formula: =INDIRECT(«B»&C2) returns a value from cell B2 based on the following logical chain:

The INDIRECT function concatenates the elements in the ref_text argument — text B and the value in cell C2 -> the value in cell C2 is number 2, which makes a reference to cell B2 -> the formula goes to cell B2 and returns its value, which is number 10.

Using the INDIRECT function with named ranges

Apart from making references from cell and text values, you can get the Excel INDIRECT function to refer to named ranges.

Suppose, you have the following named ranges in your sheet:

  • Apples — B2:B6
  • Bananas — C2:C6
  • Lemons — D2:D6

To create an Excel dynamic reference to any of the above named ranges, just enter its name in some cell, say G1, and refer to that cell from an Indirect formula =INDIRECT(G1) .

And now, you can take a step further and imbed this INDIRECT formula into other Excel functions to calculate the sum and average of the values in a given named range, or find the maximum / minimum value within the rage:

Now that you’ve got the general idea of how to use the INDIRECT function in Excel, we can experiment with more powerful formulas.

INDIRECT formula to dynamically refer to another worksheet

The usefulness of the Excel INDIRECT function is not limited to building «dynamic» cell references. You can also utilize it to refer to cells in other worksheets «on the fly», and here’s how.

Suppose, you have some important data in Sheet 1, and you want to pull that data in Sheet 2. The following screenshot demonstrates how an Excel Indirect formula can handle this task:

Let’s break apart the formula you see in the screenshot and understand.

As you know, the usual way to reference another sheet in Excel is writing the sheet’s name followed by the exclamation mark and a cell / range reference, like SheetName!Range. Since a sheet name often contains a space(s), you’d better enclose it (the name, not a space : ) in single quotes to prevent an error, for example ‘My Sheet!’$A$1.

And now, all you have to do is to enter the sheet name in one cell, the cell address in another, concatenate them in a text string, and feed that string to the INDIRECT function. Remember that in a text string, you have to enclose each element other than a cell address or number in double quotes and link all elements together using the concatenation operator (&).

Given the above, we get the following pattern:

Going back to our example, you put the sheet’s name in cell A1, and type the cell addresses in column B, as demonstrated in the screenshot above. As the result, you get the following formula:

INDIRECT(«‘» & $A$1 & «‘!» & B1)

Also, please pay attention that if you are copying the formula into multiple cells, you have to lock the reference to the sheet’s name using the absolute cell references like $A$1.

    If either of the cells that contain the 2 nd sheet’s name and cell address (A1 and B1 in the above formula) is empty, your Indirect formula will return an error. To prevent this, you can wrap the INDIRECT function in the IF function:

IF(OR($A$1=»»,B1=»»), «», INDIRECT(«‘» & $A$1 & «‘!» & B1))
For the INDIRECT formula that refers to another sheet to work correctly, the referred sheet should be open, otherwise the formula will return a #REF error. To avoid the error, you can use the IFERROR function, which will display an empty string, whatever error occurs:

Creating an Excel dynamic reference to another workbook

The Indirect formula that refers to a different Excel workbook is based on the same approach as a reference to another spreadsheet. You just have to specify the workbook’s name is addition to the sheet name and cell address.

To make things easier, let’s start with making a reference to another book in the usual way (apostrophes are added in case your book and/or sheet names contain spaces):
‘[Book_name.xlsx]Sheet_name’!Range

Assuming that the book name is in cell A2, the sheet name is in B2, and the cell address is in C2, we get the following formula:

=INDIRECT(«‘[» & $A$2 & «]» & $B$2 & «‘!» & C2)

Since you don’t want the cells containing the book’s and sheet’s names to change when copying the formula to other cells, you lock them by using absolute cell references, $A$2 and $B$2, respectively.

And now, you can easily write your own dynamic reference to another Excel workbook by using the following pattern:

Note. The workbook your formula refers to should always be open, otherwise the INDIRECT function will throw a #REF error. As usual, the IFERROR function can help you avoid it:

=IFERROR(INDIRECT(«‘[» & A2 & «]» & $A$1 & «‘!» & B1), «»)

Using Excel INDIRECT function to lock a cell reference

Normally, Microsoft Excel changes cell references when you insert new or delete existing rows or columns in a sheet. To prevent this from happening, you can use the INDIRECT function to work with cell references that should remain intact in any case.

To illustrate the difference, please do the following:

  1. Enter any value in any cell, say, number 20 in cell A1.
  2. Refer to A1 from two other cells in different ways: =A1 and =INDIRECT(«A1»)
  3. Insert a new row above row 1.

See what happens? The cell with the equal to logical operator still returns 20, because its formula has been automatically changed to =A2. The cell with the INDIRECT formula now returns 0, because the formula was not changed when a new row was inserted and it still refers to cell A1, which is currently empty:

After this demonstration, you may be under the impression that the INDIRECT function is more a nuisance than help. Okay, let’s try it another way.

Suppose, you want to sum the values in cells A2:A5, and you can easily do this using the SUM function:

However, you want the formula to remain unchanged, no matter how many rows are deleted or inserted. The most obvious solution — the use of absolute references — won’t help. To make sure, enter the formula =SUM($A$2:$A$5) in some cell, insert a new row, say at row 3, and… find the formula converted to =SUM($A$2:$A$6) .

Of course, such courtesy of Microsoft Excel will work fine in most cases. Nevertheless, there may be scenarios when you don’t want the formula to get changed automatically. The solution is to use the INDIRECT function, like this:

Since Excel perceives «A1:A5» as a mere text string rather than a range reference, it won’t make any changes when you insert or delete a row(s).

Using INDIRECT with other Excel functions

Apart from SUM, INDIRECT is frequently used with other Excel functions such as ROW, COLUMN, ADDRESS, VLOOKUP, SUMIF, to name a few.

Example 1. INDIRECT and ROW functions

Quite often, the ROW function is used in Excel to return an array of values. For example, you can use the following array formula (remember it requires pressing Ctrl + Shift + Enter ) to return the average of the 3 smallest numbers in the range A1:A10:

However, if you insert a new row in your worksheet, anywhere between rows 1 and 3, the range in the ROW function will get changed to ROW(1:4) and the formula will return the average of the 4 smallest numbers instead of 3.

To prevent this from happening, nest INDIRECT in the ROW function and your array formula will always remain correct, no matter how many rows are inserted or deleted:

Here’s a couple more examples of using INDIRECT and ROW in conjunction with the LARGE function: How to sum N largest numbers in a range.

Example 2. INDIRECT and ADDRESS functions

You can use Excel INDIRECT together with the ADDRESS function to get a value in a certain cell on the fly.

As you may remember, the ADDRESS function is used in Excel to get a cell address by the row and column numbers. For example, the formula =ADDRESS(1,3) returns the string $C$1 since C1 is the cell at the intersection of the 1 st row and 3 rd column.

To create an indirect cell reference, you simply embed the ADDRESS function into an INDIRECT formula like this:

Of course, this trivial formula only demonstrates the technique. And here are a few examples that may prove really useful:

  • INDIRECT ADDRESS formula — how to switch rows and columns.
  • VLOOKUP and INDIRECT — how to dynamically pull data from different sheets.
  • INDIRECT with INDEX / MATCH — how to bring a case-sensitive VLOOKUP formula to perfection.
  • Excel INDIRECT and COUNTIF — how to use the COUNTIF function on a non-contiguous range or a selection of cells.

Using INDIRECT with Data Validation in Excel

You can use the Excel INDIRECT function with Data Validation to create cascading drop down lists that display different choices depending on what value the user selected in the first dropdown.

A simple dependent drop-down list is really easy to make. All it takes is a few named ranges to store the dropdown’s items and a simple =INDIRECT(A2) formula where A2 is the cell displaying your first drop-down list.

To make more complex 3-level menus or drop-downs with multi-word entries, you will need a bit more complex INDIRECT formula with a nested SUBSTITUTE function.

For the detailed step-by-step guidance on how to use INDIRECT with Excel Data Validation, please check out this tutorial: How to make a dependent drop down list in Excel.

Excel INDIRECT function — possible errors and issues

As demonstrated in the above examples, the INDIRECT function is quite helpful when dealing with cell and range references. However, not all Excel users eagerly embrace it mostly because extensive use of INDIRECT in Excel formulas results in lack of transparency. The INDIRECT function is difficult to review since the cell it refers to is not the ultimate location of the value used in the formula, which is pretty confusing indeed, especially when working with large complex formulas.

In addition to the above said, like any other Excel function, INDIRECT may throw an error if you misuse the function’s arguments. Here’s a list of most typical mistakes:

Excel INDIRECT #REF! error

Most often, the INDIRECT function returns a #REF! error in three cases:

  1. ref_text is not a valid cell reference. If the ref_text parameter in your Indirect formula is not a valid cell reference, the formula will result in the #REF! error value. To avoid possible issues, please check the INDIRECT function’s arguments.
  2. Range limit is exceeded. If the ref_text argument of your Indirect formula refers to a range of cells beyond the row limit of 1,048,576 or the column limit of 16,384, you will also get the #REF error in Excel 2007, 2010 and Excel 2013. Earlier Excel versions ignore the exceeded limit and do return some value, though often not the one you’d expect.
  3. The referred sheet or workbook is closed. If your Indirect formula refers to another Excel workbook or worksheet, that other workbook / spreadsheet must be open, otherwise INDIRECT returns the #REF! error.

Excel INDIRECT #NAME? error

This is the most obvious case, implying that there is some error in the function’s name, which leads us to the next point : )

Using the INDIRECT function in non-English locales

You may be curious to know that the English name of the INDIRECT function has been translated into 14 languages, including:

  • Danish — INDIREKTE
  • Finnish — EPГ„SUORA
  • German — INDIREKT
  • Hungarian — INDIREKT
  • Italian — INDIRETTO
  • Norwegian — INDIREKTE
  • Polish — ADR.POЕљR
  • Spanish — INDIRECTO
  • Swedish — INDIREKT
  • Turkish — DOLAYLI

If you are interested to get the full list, please check out this page.

A common problem with non-English localizations is not the INDIRECT function’s name, but rather different Regional Settings for the List Separator. In the standard Windows configuration for North America and some other countries, the default List Separator is a comma. While in European countries, the comma is reserved as the Decimal Symbol and the List Separator is set to semicolon.

As a result, when copying a formula between two different Excel locales, you may get the error message «We found a problem with this formula…» because the List separator used in the formula is different from what is set on your machine. If you run into this error when copying some INDIRECT formula from this tutorial into your Excel, simply replace all commas (,) with semicolons (;) to get it fixed.

To check which List Separator and Decimal Symbol are set on your machine, open the Control Panel, and go to Region and Language > Additional Settings.

Hopefully, this tutorial has shed some light on using INDIRECT in Excel. Now that you know its strengths and limitations, it’s time to give it a shot and see how the INDIRECT function can simplify your Excel tasks. Thank you for reading!

You may also be interested in

Table of contents

Want to reference a defined data name based on the value in a cell.

I have defined data names Itemized_Deduction_Amt and Standard_Deduction_Amt. I have in cell C1 a formula the returns either the word Itemized or Standard. I want to use C1 result to construct the data name to be used. For instance,C1 & «_Deduction_Amt» where C1 = Itemized will create data name Itemized_Deduction_Amt. When C1 = Standard, data name would be Standard_Deduction_Amt.

Instead of using the following formula
If(Itemized_Deduction_Amt > Standard_Deduction_Amt,Itemized_Deduction_Amt,Standard_Deduction_Amt)
I want to just use the created data name.
I tried several ways including the following that did not work:
= Indirect(C1 & «_Deduction_Amt»)
= C1 & «_Deduction_Amt»

Hello!
This formula works for me:

Maybe there are extra spaces or other extra characters in your values.

=AND(ISNUMBER(SEARCH(«-«,[@[PO number]])),LEN([@[PO number]])=13)

=AND(ISNUMBER(SEARCH(«-«,INDIRECT(«[@[PO number]]»))),(LEN(INDIRECT(«[@[PO number]]»)=13)))

i am doing something wrong but i have no idea what as the first one works then i turn in to data validation

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking.

yes I am check if a number is enter in the cell is a number and has 13 characters including a —

all numbers are stored in table PO number, table name Dailyintake

if it fails ether of these checks I want to not let me enter the number

Hi!
I don’t quite understand your problem, because 2000000-0000 is not a number. It is a string because it contains a «-«. You can check the length of the text with the function LEN(A1)=13 If you need to enter text according to the pattern, maybe this article will be helpful: Excel Data Validation using regular expressions (Regex).

that’s strange because this =AND(ISNUMBER(SEARCH(«-«,[@[PO number]])),LEN([@[PO number]])=13) seems to work when its in a cell refencing the table it will result in the correct true or false statement when used like that but completely brakes when i turn it in to a INDIRECT version for the use in data validation.

ill definitely have look at that as it looks like it might do what i want it to do

I know have a good understanding of Regex 200000-000000

How would I turn this in to the INDIRECT is the something that i can read that cover this

I have got it fantastic

Hi!
It is very difficult to understand a formula that contains unique references to your workbook worksheets. Hence, I cannot check its work, sorry.

yeah I broke it ill get it eventually

Table1 is the table name

Data is the headers on the tables name

200000-000000 is the cell data

I removed all the cell refences

as far as I can tell the ISNUMBER INDIRECT version always comeback as false and the Len checker doesn’t work at all

I have values in A column in B1 I have text as SUM. Hence in C1 I have to get sum of values of A Column and if write AVERAGE in B1 than in C1 I have get average values of A column

Hi!
Excel cannot use your text in a formula as the function name. However, you can create a formula with conditions using the IF function.
For example,

I am attempting to compile the sum of data from multiple different sheets under certain criteria.

Example: Summary, Sheet2, Sheet3. On Summary in A1, sum total number amounts from Sheet2 in B:B if Value in C:C = Green, then again on Summary in B1, the sum total number amounts from Sheet3 in B:B if Value in C:C = Green. I hope this makes sense.

I learned from this page how to pull individual certain cell data but not the sum of data under a specific criteria. It may combine with the Countif or Sumif function but cant figure out how to make it work. I greatly appreciate your help. Thank you.

Hello!
If I understand correctly, here is an example formula for summing by conditions. See this article for detailed instructions and examples: Excel SUMIFS and SUMIF with multiple criteria – formula examples.

Hi
My current issue is i have to sheets lets say
Sheet1 is where the formula is so
Countif(sheet2A:A;$C$3) this formula will be in cell C5 and the C6,C7, C8

What i need is to move the auto fill series to move ranges on sheet2 to be filled as the formula on C6 to query B:B, C7 to query C:C and so on

Can you help me with the formula syntax please

Hi. Thank you for a great guide. It helped me simplify my spreadsheets a lot.

I was wondering if there is a way to make the name of the reference sheet change dynamically?

I have a spreadsheet for each week of the year. The sheet is named after the week, then a comma, then a space and then the year. E.g: «1, 2023» «2, 2023» etc.
The cells I want to access are always in the previous sheet. In other words: «‘this_sheet’s_weeknumber-1, 2023». Is there any way to do this so that when I copy the sheets from the week before, I don’t have to change any formulas?

It’s not a big deal, since I manually only have to change 1 number every time I make a new sheet, however it would be fun to make it so I don’t have to manually change anything.

I like to avoid manual change as you like.
I believe you could use the function (Sheet) to solve your issue.
Hope all the best for you

Hi there,
I am using =FILTER very successfully but the «include» criteria I want to use, extend into an enormous list because of a variety of different choices I have set up to make a large number of different filters available to my users, with the result of the filter always appearing in the same space. So I want to «break down» the =FILTER formula I am using by referring to various lists of «include criteria» which I will store in different cells. I have been embedding SWITCH and INDIRECT functions into my =FILTER formula but always end up with a #VALUE! error.
Is there any way to make «include criteria» dynamic rather than having to boringly spell them out in the =FILTER formula itself?
So . say I have ten different varieties of «include criteria» . I have to make ten nested IF statements inside my =FILTER formula. It is really tedious.
What I am doing is giving my users up to ten different «saved filters» so they can quickly flick between one filter and another and save their favourite ones etc. Sometimes, these saved filters use «AND» and sometimes they use «OR» and they all use up to ten different columns from my huge array of data to be filtered. The data is obviously kept in a different Tab.
To save my =FILTER formula from growing into hundreds if not thousands of characters, all I want to do is to «import» «include criteria» from a series of different cells, which I can tuck away out of sight somewhere.
Any ideas?
Thank you so much if you are able to solve this one for me!!
Kind regards — Jon

Hello!
If I understand your task correctly, the following tutorial should help: Using Advanced Filter in Excel — criteria range examples with formulas.

=INDIRECT(«‘» & $A$1 & «‘!» & B1)
this formula not working my workbook.

my workbook are many sheets but i was collect a data in one sheet..
many sheets ex. 1 2 3 4 5 6
& main sheet Sum. =INDIRECT(«‘» & $A$1 & «‘!» & B1)

Hi!
Look carefully at the example in the article above. Cell B1 should contain the address of the cell.

Hi. I have used INDIRECT with dynamic references for years and I decided to upgrade from Excel 2013 to 2021. Now I get #REF! from all of my formulas using INDIRECT with dynamic references. I came across this article and found out why 🙁

I use the dynamic references to look up values from previous years without needing to enter the new year in the formulas every year and not needing to have the previous years workbook open.

Is there a way to get values from other workbooks by using dynamic references without having to open them?

Hello!
You can get data from Excel without opening a file using a VBA macro. Here is the article that may be helpful to you: How to duplicate sheet in Excel with VBA.

how can i use indirect for different sheet and variable row number?

Hi!
Pay attention to the following paragraph of the article above – Creating a dynamic reference to another sheet.
You can write the sheet name in a separate cell and refer to it in a formula.

Firstly, thank you for creating such a comprehensive article! Extremely helpful to many, I’m sure. Secondly, I don’t think this specific post can help with my issue, but perhaps you can point me in the right direction?

I have a template that I am creating (so formulas will need to be dynamic as rows will be added) where I’m trying to continue the row numbers while skipping headers. Here is an example of what it should be when complete:

A B C
1 data data
2 data data
3 data data
Header
4 data data
5 data data
6 data data
Header
7 data data

The issue is that the template doesn’t look like the example above, as the data isn’t populated yet. The template looks like this:

A B C
formula data data
Header
formula data data
Header
formula data data

How can I start numbering in A1, skipping headers and continuing numbering, without being able to tell Excel where the last number above Header 1 left off?

Hello!
Please try to enter the following formula in cell A2 and then copy it down along the column:

Please check out this article to learn how to find the highest value.

This is an excellent article. My problem seems not addressed exactly with the INDIRECT and ROW syntax

Here is what I am trying to do:

I have a row of stock values in row 12 in Excel with the headings above that row, row 11. Like so:

Date Open High Low Close Adj Close* Volume
Jan 31, 2022 173.88 175.28 172.75 173.40 173.47 65,518,109

In another column to the right, I have the 12 months of the year, starting with January down to December.

In the column right next to the months, I have a formula to calculate the Net Value for that month.

Each close of the month, I insert a new cells below row 11 (the headings) containing the same data as above only with the next last day of the months values. So in the above, it will be February 28th.

I want January’s Net Value to stay the same. But I want February’s value to now be of off the new inserted row.

I cannot seem to get there with the INDIRECT and ROW functions. If I insert a new row, January’s Net Value changes to February’s.

Hi!
The information you provided is not enough to understand your case and give you any advice.
What formula do you use to calculate? Are you inserting a new blank row 12 and writing February data into it? In this case, the January data is moved to row 13?

It is comprised of two actions at the present time.

The first is a Macro to move down the date one row.

Sub APPL()

‘ StockUpdate Macro
‘ Process to update Yahoo’s Data in Spreadsheet

‘ Keyboard Shortcut: Ctrl+a

Range(«A32:H32»).Select
Selection.Copy
Selection.Insert Shift:=xlDown
End Sub

The second was /is this formula in Column J.
=INDIRECT(«E»&60-ROW())*500-1000

When I add new data in «A32:H32» the last day of each month, the formula in Column J calculates the net value. What I desire is Column J’s previous month to stay the same, but each new month calculate the new value.

What is happening now is the new value replaces the existing values all the previous months. I want to keep that historical record so to speak.

Hi!
I’m not sure I understood your explanation. If you want the reference to point to the same value, use a relative cell reference. Then, when inserting rows, the value of the formula will not change.

Each month, at the end of the month, I obtain from Yahoo the ending Hi, Low , and close of a give stock price.

I inset that row of data in a row above last months stock information.

I take the closing price from that row and multiply it by number of shares and then subtract the original purchase price. This gives me the loss or capital gains.

This gain or loss gets copied to another column where it is place next to a column with the month of the year. The months go down.

I want that monthly value to stay the same as listed for each past month, but update for each new month.

Right now my formula as I drag down changes and so does then the previous months values.

Inputting new rows breaks the use of fixed references with $ signs.

Let change gears and see if this will work with your help. I am so close . . .

I have this code below to take a variable that changes and place it in another cell, and then as the variable changes each month (like what I am trying to do above), keep the last variable, while updating the next row with the new variable.

It works, except the VBA code works only IF the data is inputted by hand. IF the data is changed by reference to another cell or workbook i.e. A1= sheet6 C1 and C1 changes the A1 value then it does — unfortunately. — not work.

Is there a way to fix this problem?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = «$B$2» Then
a = Sheets(«Sheet2»).Cells(Rows.Count, «A»).End(xlUp).Row + 1
Sheets(«Sheet2»).Range(«A» & a).Value = Sheets(«Sheet1»).Range(«B2»).Value
End If
End Sub

Many times i feel very confused with how to handle it in excel. I really need articles like yours. I felt very inconvenient, so I went to apkdownload and found something to help. Crazy, there are a few apps that can share how to or tips for excel. But I still prefer articles like yours

My wife asked me to help her create an excel document for her work where in two columns I need dependent drop down lists.

The main drop down (cell G3, only has single word data) and the first dependent list (H3, gives results of a couple of sentences) was easy. In a parameters sheet I grouped the specific data and gave it a name that corresponds to one of the four choices of cell G3. On the work sheet I used the =INDIRECT function in cell H3 (first dependent drop down)

Now I’ve been struggling for a couple of days on getting the second dependent drop down (I3) to work. If I use the same function as in H3 then it returns the same options as in H3. When I try to direct it to the correct group name it doesn’t work.

The drop down options in H3 are all sentences (with spaces) and I think that’s what causing the issue.

Can anyone help/advice on how to get the right drop down data in I3 based on the main drop down (G3)
I3 doesnt even need to depend on whats in the first dependent drop down list (H3) solely on whats in the main drop down list in G3.

Thank you in advance!
Rico

Hello!
Here is the article that may be helpful to you: How to make a dependent (cascading) drop-down list in Excel.
This should solve your task.

Thanks Alexander. I will give it a try.

I like how clear your explanation is, but I am trying to go in the opposite direction. I use VLOOKUP to get a cell reference to a location to some value (Current Data). I use the existing value from that cell, update the value, and then want to update the original location, making it Updated Data. I was able to use the indirect function to get the Current Data, but I can’t find anything that Excel will let me do to indirectly store the data back in the original cell again. I have to do indirection, since I have many cells that have to be processed, and use a table to get the cell references to the data cells. This is basically a A = A+B problem. Any idea on how to stuff the data back into the cell again. Thanks.
Tim Ryan

Hello!
Unfortunately, I could not understand your problem. Give an example of the values and cells you are searching and updating.

Hi there, I think I understand how the behavior works for R3C. It is not referring to the same column (in your explanation above, the arrow pointed to column C), it is actually referring to the same column where the Indirect formula located (in this case, column D).

If you try to put «Test» in D2 and update the text in C5 from R3C to R2C, cell D5 will appear «Test» (Indirect formula is referring to the same column but row 2, which has a «Test» now)

From all appearances, you are right. Thank you for explaining this case, I will update the example.

I was looking to do this while summing across multiple tabs. The normal formula is

=SUM(‘assets 1:end 2’!$F$4)

I’ve tried the following but it isnt working could you assist?

C$75 = assets 1
$P$7 = end 2
$C$74 = F

Hello!
Unfortunately, you cannot get a 3D reference using the INDIRECT function.

I’m trying to sum the same cells (C9,C10. C80) from multiple sheets onto a ‘totals’ sheets, but the data is on-going so I want to be able to update it to include a new sheet each month.

If it were static this is what I would do:
=SUM(July:December!C9)
and it would be great.

However I want ‘December’ to be dynamic so that it is possible to just change one cell from ‘December’ to ‘January’, and have C9. C80 all update automatically based on a formula.

I was trying this

where F2 is the new month, and G2 is the text «C9», however I get the error #NAME? returned, and in the formula builder it says «Volatile».

Hello!
The 3D link cannot be created using the INDIRECT function.
If you want to sum the same cell from all sheets except the current one, just enter a formula like this:

The sign * serves as a wildcard, which is interpreted as «all sheets except this one». When you press Enter after entering this formula, Excel converts the formula to use the actual sheet names.

@Liam
It is in fact possible to do what you want, but I don ‘t know if you are interested after such a long time.

I would like an answer to this if you have it.

I have the following on Sheet1:
=SUMIFS(test!C3:C156,test!A3:A156,($B3))

I am trying to set the upper range of the search, 156, in cell Sheet1 A1. I tried the following:

What is the correct syntax?

Hello!
In the SUMIFS function, you cannot specify a formula instead of a range.
Use the SUMPRODUCT function:

I hope I answered your question. If something is still unclear, please feel free to ask.

I was really helped out by just going through the samples on this page.
My workbook consisted of several sheets, and I was impressed of the flexibility of the INDIRECT function combining information between them, all due to your thorough details.
This made me able to dynamically update formulas in the relevant cells.
I highly recommend this page .

Hello, is there an alternative to indirect command to make a dynamic reference to another workbook without needing that other workbook open, likea direct reference formula does? I’m trying to make a spreadsheet that will gather data from 30 other spreadsheets, so I’d like it to work without needing 30 spreadsheets open.

I have any issue that when I am using the following formula and when I insert a row if the spread sheet 2 call People (same name as H4 in the master sheet), then the reference should change from !B12 to !B13 but it did not change.

=INDIRECT(«‘» & H4 & «‘!B12»)

Could anyone able to help me out with this.

Hello!
The link will not change from B12 to B13 as «B12» is text. Note the section above in this article: Creating an Excel dynamic reference to another worksheet.
I hope my advice will help you solve your task.

I have the same question here, and dont know if this possible.

Is there a way to make the cell name recognize as just text the B12 in Franks first formula, and be able to copy that formula down. So when i pull down the formula it would allow me to reference a different cell on the other worksheet.

I want the H4 refence to stay the same (and I have that done), but I want the cell number (the B12) to change for the referenced sheet, not looking at the current one.

Easier way to ask. Can I make the Range dynamic, to reference another cell another worksheet.

Hello!
You can make the row number change as the formula is copied down the column by replacing it with the ROW function.

=INDIRECT(«‘» & H4 & «‘!B»&ROW(A12))

Pay attention to the following paragraph of the article above — INDIRECT with other functions (ROW, ADDRESS, VLOOKUP).

Hi! I’m trying to create a two-level drop down list for more than 500 cells and needs to use the indirect function. How can I make this happen without doing it one by one? Is there any formula I can use? Thanks! 🙂

Hello!
The information presented to you is not enough to give you advice.
You might find it helpful to read this tutorial on creating dependent dropdown lists.

Very very useful. It help so much, thank you!

Extremely helpful page!! Many many thanks!!

Dear Sir,
I have a problem using QUOTE function with INDIRECT function.
The QUOTE function format is =quote(«146.1.JYC.ASX»,»Last»)
I break up the function into 3 texts in 3 cells.
D1 => quote(«146.1.
D2 => JYC
D3 => .ASX»,»Last»)
CONCATENATE function: concatenate(D1, D2, D3) will looks like the quote(«146.1.JYC.ASX»,»Last»).
If I apply INDIRECT function with the CONCATENATE function, and the result is «#REF».
Can you help to solve my problem because D2 will change from time to time.
Thanks for your early reply.
Edward Wong

Hello!
I would like to learn more from you about the «QUOTE function».
You wrote: «If I apply INDIRECT function with the CONCATENATE function, and the result is“ #REF ”.» What formula did you use?
What result would you like to get?

Hi Alexander,
Thank you for you interesting in this.
To make use of QUOTE function, you must have Excel QUOTES add-in (https://gaiersoftware.com/Excel/) to MS Office.
And quote(«146.1.JYC.ASX»,»Last») will get the latest price of the stock «Joyce Corporation Ltd» from Australia stock market.
I put the formula =quote(«146.1.JYC.ASX»,»Last») to cell F1 and get $1.15 at the moment.
So, I think you will understand what I expect by using CONCATENATE function with QUOTE function to achieve another stock latest price as D2 change.

Hi Alexander,
Thank you for you interesting in this matter.
Finally, I figure it out. It is not relate to INDIRECT function.
My solution as follow:
Put JYC in Cell D2
Put the QUOTE formula =QUOTE(CONCATENATE(«146.1.»,D2,».ASX»),»Last») in cell F1 hence get $1.1.05 as a result.
If you change D2 to APA and get $11.34
That is what I want to do.
Thanks you once again.

I want how to get the excel sheet 1 cells in sheet 2 what is the formula in that

I want to extract a value from a different workbook (containing multiple sheets named — state 1 , state 2) such that «state» is fixed and i will input value 1/2 each time in a cell and based on it excel should extract value from state 1 or state 2 sheet. how can i frame the indirect formula? (keeping in mind that fixed «state» string needs to be concatenated with 1/2 input cell. Also state 1 or state 2 has spaces in between)

G19=id dump 10th dec»19 H19=dump

Above are file and sheet name (dump) respectively
Index(INDIRECT(«‘[«&G19&»]»&H19&»‘!»&$E:$F)
However within index it is showing error

Thank you for the info it is very useful
I’m using the following formula to get the count of the number 150 from a worksheet without an issue,
=SUMPRODUCT(COUNTIF(INDIRECT(«‘My Sheet 1″&»‘!A1:L300»),150))
For some reason i can not figure out the proper syntax to use across multiple worksheets to reference or example I want to count the number 150 across 3 Sheets that are not next to each other. How can i syntax it lets say they are named
My Sheet 1, My Sheet 2, My Sheet 4

When I use this formula it works for the first cell, but when I drag it down 20 rows it does not work. It will change the sheet reference (A2, A3, A4), but it populates the result from A2 (the starting point). If I manually change A3 to A3 or A4 to A4 in the dragged down formula . then it will give me the proper result. For example:

=INDIRECT(«‘» & A2 & «‘!B12») . correct result is 2932
=INDIRECT(«‘» & A3 & «‘!B12») . correct result is 200 but excel gives me 2932. when dragged A2 changed to A3 but still get A2 result.
=INDIRECT(«‘» & A4 & «‘!B12») . correct result is 1500 but excel gives me 2932. when dragged A3 changed to A4 but still get A2 result.

Can someone explain what I am doing wrong?
thanks
Dee

I have this same issue; did you get it resolved?

I am also having this issue and can’t seem to find an answer.

Try to change the formula to: =INDIRECT(«‘» & A2 & «‘!B:B»)

how to give dynamic range every time to get sum in excel sheet

I am trying to sum multiple spreadsheets by using the tab name to identify the start and end sheets. But I keep getting a «ref» error. Any thoughts?
=SUM(INDIRECT(«‘» & CONCATENATE(RIGHT(CELL(«filename»),LEN(CELL(«filename»))-FIND(«]»,CELL(«filename»))),» Start:»,RIGHT(CELL(«filename»),LEN(CELL(«filename»))-FIND(«]»,CELL(«filename»))),» End’!»,ADDRESS(ROW(),COLUMN()),»)»)))

Is there a way to use indirect in multiple columns in the same sheet?
I have made a sheet (sheet A) listing info from other sheets (B,C,D).
If I want to add sheet E, I now have to also add a row in Sheet A which will refer to sheet E, in this new row I pull through the formulas from the row above.
I don’t want to have to change the formulas in every column to fit with the correct sheetname. With the indirect formula that works, only so for one column.

I’d attach an example file, but don’t see how to.

Looking forward to your reply,
Kind regards,
Ben

Some more deduced clearer info.
The cell wrongly displaying refers to a cell in which dependant validation is present.
The cell I refer to on the sheet I refer to with the indirect formula, the content is depending on the value of an other cell, I use the indirect formula to make a dependant validation. Which creates the problem.
Any tips on a workaround?
I do need the dependant validation as much as the indirect reference
Made a screenshot with some info, find it here:
https://drive.google.com/file/d/1QPSHrXqPG7dNJD6XGy9ZOG73mLaHrirH/view?usp=sharing
regards,
Ben

Best wishes; from everyone of us.

I am having an issue getting something to work properly.

I have a workbook that contains a list of Websites, and under each website are the names of the users that are considered experts with those websites. Rather than having people have to search through to find an expert they want to ask questions of, I created a new sheet that includes a drop down list of the websites.

When a user clicks on the drop down list (which is in C2), and selects a website, I am wanting to populate that list in in column F, starting at F2.

I have the basics of it working fine. The issue I am having is that each website has a different number of ‘experts’. Some only have one, and some have over fifteen.

My issue is that (unless I am missing something), I needed to place the formula in all 20 cells, so that all the experts would fit. Now, when a website is selected that has less than the maximum number of experts, the remaining cells show #N/A.

I have tried using an =IFERROR to get rid of the #N/A, but am not having any luck.

Do you have any suggestions?

Here are the basics of the code:

The website drop down list is done with Data Validation, using the named range: =Websites

For the experts list, I have used: =INDIRECT($C$2)

When that came up with the extra #N/A’s, I change it to: =IFERROR(INDIRECT($C$2),»»)

Unfortunately, that did not get rid of the #N/A’s.

The list looks similar to this:

John Smith
Fred Jones
Steve Major
Rod Hawke
#N/A
#N/A
#N/A

Thank you,
Jason

Hi, I have a cell A4 that has another cell’s address in it. So cell A4 reads $D$2, it is a dynamic value. How do I use the offset function to reference this cell? I want it to reference the dynamic cell address rather than the cell A4, which contains this information.

EXCELLENT — THANK YOU — works like a dream.

Can you use INDIRECT fron one sheet to another sheet?

Great post, nice examples, you save me a lot of time. Thanks!

Good post, really useful. However it doesn’t fix the problem for my unfortunately 🙁
I need a formula in which I can update the links every month easily. However, I don’t get the indirect function to work :(. For example, the data that needs to be updated monthly is linkt to follow directionary for januari 2017

=(‘M:SSCVestigingsmanagementMebin20171 2017Rapportages[amsterdam totaal KER Template 2017.xlsx]Samenvatting’!$E$113)

Februari 2017 is linked to:=(‘M:SSCVestigingsmanagementMebin20172 2017Rapportages[amsterdam totaal KER Template 2017.xlsx]Samenvatting’!$E$113)

The only thing that changed is 01 to 02. So my idea to make a template, in which I can select 01/02/03 depending on what month I need, that the links automatically changed with it. Is there a way to do that? The search and change function(ctrl+F) is not an option, since it is not very accurate!

I hope somebody can help me! Thanks in advance!

Very very helpful, thank you!

Really good post! Excellent examples. Very helpful. I might use something similar even in VBA. Thank you and Merry Christmas 🙂

Hello
I am trying to create a dependent drop down list using the following formula =INDIRECT(SUBSTITUTE(F2,» «,»_»))
However, I get the #REF! error

One of your initial examples has a mistake in the description.

The formula =INDIRECT(C5,FALSE) is in cell D5. So, the formula grabs the value in C5 (R3C) and turns that into the cell reference D3, not C3, because the formula is in column D.

There is no double indirection. The blue arrow in your diagram from cell C5 should really point to cell D3, because the INDIRECT formula is in Column D.

You can easily test this by changing the value in D3. D5 changes as well.

By the way, this also explains the confusion you describe here:
In all honesty, I failed to come up with
any plausible explanation of such behavior,
maybe it’s just a quirk of Excel INDIRECT.

I have a workbook with lots of basic formulas just like =’Cost Detail’!A1
I would like to change the ‘Cost Detail’! part by an INDIRECT function.
I would like to do so by «search and replace». But the A1 part should not change inside the formula. I cannot find a way to do it without rewriting each one of my 400 formulas. Can you help me?

is it possible to combine indirect and index? or is it impossible without VBA to cell values in closed workbooks?

eg. =index(‘c:temp[filename.xlsx]sheet1’!A2,1,1) gives the value of a non open excel file..

so if i have the different part in cells
a1: C:temp
a2: filename.xlsx
a3:sheet1
a4: a2

the formula =»‘»&A1&»[«&A2&»]»&A3&»‘!»&A4 gives the «correct» string.. I could copy this and parse it as value (and then edit the cell and enter)..

In one workbook I have two worksheets: Analysis and Items.Items contains detail line items sold with a customer ID in column N. There may be one or many rows with the same customer ID. In Analysis WS I want a count of when the customer ID changes in Items WS(counting number of customers).Using Countifs function as there are multiple criteria. Want to compare value of N to N of previous row. Can you help? Tried Index and Offset, but no luck.

Hi ,
SOS. I have non contiguous cells on one sheet ( different sheets) and i want to sum or average them using indirect function. How does it work ? Many thanks.

Hi JM Badi,
As you might have noticed in the examples, AVERAGE and SUM functions are used with INDIRECT when it is referred to a cell with already named range. So you will most likely have to create a long INDIRECT formula, creating additional cell references for your non contiguous cells from different sheets.
You can find it explained in more details here.

I’m having trouble getting «Creating an Excel dynamic reference to another workbook» to work. I type this in verbatim — nothing but REF#.

I understand the big picture regarding how it works. I also have the source sheet open. I tried closing and re-opening the source workbook again, no good.

Any assistance would be deeply welcomed and appreciated.

Nevermind, I figured it out. I needed to type the following: =INDIRECT(«‘[«&$A$2&».xlsx]»&$B$2&»‘!»&C2)

I am using the INDIRECT function to pull data from another tab in the current worksheet. When I edit the location I get the REF error. When I cut and paste the same text it works?

=COUNTIF(D6:D31,1,(«1=Trivandrum»),(«2=Kollam»),(«3=Pathanamthitta»)
please correct this

Hi Svetlana Cheusheva

A1 jhon
A2 krish
A3 robert

B1 50
B2 100
B3 150

now i need formula for

Column D jhon 50
Column E krish 100
Column F robert 150
Auto insert value of persons

you can comple this please, and explain my more , indirect(adresse(count())) help do it.

Hello,
Not sure if something changed from the time this was posted but I found a bug in your syntax for the sheet reference example on my system.

You listed the following syntax INDIRECT(«‘» & $A$1 & «‘!» & B1)
But that yields #REF error until the last quote is moved right of the cell address «B1». At least from my test on Office2016 your example fails until I do this.

INDIRECT(«‘» & $A$1 & «‘!» & B1) BROKEN
INDIRECT(«‘» & $A$1 & «‘!B1») WORKING

I was so intrigue by your article, would it be possible to send me an example sheet so that I could download it and use it in my work.

Thank so much, Edward

How to use INDIRECT function in Excel — formula examples

Please help to me,
1,2,3,4,5,6,7,8,9,10. etc have magic number and models in customer list and I want to reference like that
10,21,32,34,35,45,46,48,67,56,43. Please assists to me.

I’m trying to pull data from another workbook on our SharePoint site.

C1 = «http://blueshare/Departments/Finance/Budget» and Rates/Billing/Generation Partners Workpapers/2016/09 — Generation Partners Workbooks September 2016/Residential Worksheet September 2016.xlsx
A3 = Data Input Worksheet

I’m typing in the range: C18:CV55.

Please tell me why it’s not working. Thanks.

It looks like you are putting the entire path in square brackets. Shouldn’t just the file be in square brackets?

And because there are spaces in the filepath you might need to add single quotes around the whole file name. Have a look at the Creating an Excel dynamic reference to another workbook for the correct syntax.

Good day and thank you for helping all of us!
I have an issue and I’d be so thankful if you could help me.
I have a spreadsheet (daily data) that pulls data from a closed workbook.
I have a folder (auto) with data from every day as a different workbook. Nov 09.xlsx, Nov 10.xlsx, Nov 11.xlsx, etc.

in my example, the data is shown in cell V21 in my ‘daily data’ spreadsheet. the formula for V21 is =’I:DODIntervalsauto[Nov 09.xlsx]Daily DOD’!$F21

Now, what I need is the ability to use another cell in my ‘daily data’ spreadsheet, where I type the date I need the formula in V21 to pull data from.

so I want to use cell A1 to type a date (Nov 09 in this case) and have cell V21 go to ‘I:DODIntervalsauto[Nov 09.xlsx]Daily DOD’!$F21 and give me that data. but if I change the date in A1 to, say Dec 10, I want cell V21 to give me the data in ‘I:DODIntervalsauto[Dec 10.xlsx]Daily DOD’!$F21 instead.
Is there a way to concatenate the date in A1 to the formula in V21? or is there other function/ formula I could use to automate this process, instead if changing the formula in V21 manually every time I change the date I want to see?

I need help with an indirect formula. I have drop-down two columns, say A and B. If the choice «Pres» «Corres» or «Other» is selected in column A, I want column B to display the relevant drop-down listing.

My indirect formula works exceptional. However, the problem I’m having is that when I enter «Other» I want the cell in Column B to able to input my own information. And because I don’t have any info in the drop-down for «Other» it’s coming up blank.

Is there a way for the dropdown to occur for only «Pres» and «Corres» only and allow text for «Other»?

Hi Svetlana Cheusheva

I need help in the following data. on the basis of multiple conditions I want to put a Text value (Result). Like as per Voucher Dt., CHQ Dt., CF Report and Status the text value should come accordingly.

suppose if voucher dt. (Specific month dt) + chq dt.(Specific month dt) + CF Report (Specific condition) + Status (Specific Status Name) then Result (Text Name) should come on the basis of all specific conditions.

Voucher Dt. CHQ. Dt. Name Amt CF Report Status Result
15-08-16 15-08-16 ABC 500.00 Chq in Hand Received CDC
20-06-16 05-08-16 DEF 400.00 Chq in Hand Not Received PDC
21-06-16 05-08-16 GHI 500.00 Factoring Received DISCOUNT CHQ
25-08-16 25-08-16 JKL 300.00 Cash in Hand Received CASH
06-08-16 06-08-16 MNO 400.00 Chq in Hand Not Received CDC

Hi,
I’m trying to combine INDIRECT with a 3D consolidation, doesn’t seem to be working:
Sheet: A, B and C
each have :
A1 = 1 for sheet A
A1 = 2 for sheet B
A1 = 3 for sheet C
if I do:
=sum(A:C!A1) then I get: 6

but if I do: =sum(indirect(A:C!A1))
then I get an error.

Any idea ?
Thank you for your help

explain the formula =iferror(index(dddd,small(if(dddd»»,row(indirect(«1:»&rows(dddd)))),row(indirect(«1:»&rows(dddd)))),»»)

I’m using the following formula and when i insert a row in the source worksheet, the cell reference should change to F57 but it does not.

It doesn’t change because «F56″ is interpreted as text when placed between the quotes»» not as a cell reference. Thus changes to rows columns do not impact it.

You will see the A2 shift because it is placed as a cell ref between the &&. I am battling a similar problem where I want the «F56» to increment but it wont. In the example in the article the author lists the following syntax (INDIRECT(«‘»&A2&»‘»&»!»&F56). This would allow F56 to increment but it is fundamentally incorrect because it is trying to place the contents of F56 on the current sheet into the string rather than appending just the letter F and number 56 to the string for later lookup in the proper sheet. Let me know if you find the answer.

Any fix on this one yet?

after applying indirect function on data if some data is added is this function applied to that data..i checed that but it is not taking the newly added data ..
thank u

Ablebits.com i love you too much in-fact you’ve made me like and understand excel so much thank u.

I have two sheets Sheet1 and Milk, I intend to get data from sheet «Milk» sheet1. I «=Milk!$AJ30» put this in formula bar, i need to get fixed column but varied row in Sheet1. I could not get the desired result.
I only get fixed column AJ and same Row 30 every time when I drag by the handle. it works vertically not horizontally.
i want result in the rows.
Regards
Qamar

When I try =SUM(INDIRECT($A22&»!$C$3″)) which has text in ($C$3) it comes back with 0.
Any ideas on how to get the text from that sheet to display. 🙂

Robert this error may be because you are NOT using sheet reference.

Let says your sheet name is «XYZ». IN any sheet put A1- XYZ

Then use indirect like INDIRECT(A1&»!»&»a2:b3″).
Here A1 will refer to XYZ
! refer to XYZ!
A2: B3 : if lets say is your sheet range.

This will give you sheet reference

Wow thank you.. You re genius.. Really help

sheet name is x,
I have a column name Ex: 7(g:g),

I want to use Indirect with sheetname (X) and column number 7(g:g), column number will be changed 8 and 9 and 10. any idea.

Hello,
my question is the following :

I wish to use the cells in column E to reference the value of its correlative C cell WHEN the value in the E cell is 1.

In the F1 cell, is where I would like for this value to appear.

I have tried with the INDIRECT function, and I think it’s the most probable answer, but I can’t seem to get it quite right.
e.g.

In F1 must appear value in C2 if E2=1 (if E2 is blank or 0, omit)
In F1 must appear value in C3 if E3=1 (if E3 is blank or 0, omit)
In F1 must appear value in C4 if E4=1 (if E4 is blank or 0, omit)
and so on.

Is there any simple formula to do this?

Thanks, in advance.

I am trying to use Indirect to get text from a cell in another sheet
=SUM(INDIRECT($A22&»!$B$3″)) gets me the date ($B$3) that is in the sheet name in ($A22).
When I try =SUM(INDIRECT($A22&»!$C$3″)) which has text in ($C$3) it comes back with 0.
Any ideas on how to get the text from that sheet to display. 🙂

What do you expect the «sum» of «text» to be? I am not sure if I am more concerned that you are trying to sum a single cell or that you are trying to sum text. What is the cube root of banana?

If you remove the sum function it will return the text.

Using indirect address with match sum up the salary for respective months.start month is Feb and end month is june
A salary
Jan4000
Feb2000 stare end totsal
Mar1000 feb june
Apr5000
May3000
June 1ooo

estoy tratando de aplicar la formula =INDIRECT(SUBSTITUTE,(B2,»»,»)) pero al momento de darle aplicar el sistema no me la reconoce me podrian colaborar por favor gracias

There are no quirk in Excel with indirect function.
You misunderstood the indirect(R3C) reference. As the function is written in Cell D5 (row3, colonne4) it directly go and catch the value in (Row3, colonne4)

indirect(R3C4) = is looking for Row3 Colonne4
When no reference to the number of the column is done (indirect(R3C) then it refers to the column where the formula (look for which cell the equal(=) sign is)

Also you should change your blue array in you sreenshot. The array from C5 to C3 should be change into C5 to D3

As a conclusion the formula in D5: «=Indirect(C5,false)» return the value of R3C3 as expected (ie «R2C1»)

If you want the indirect to go further and catch 222 (Cell A2) then you should have written:
=INDIRECT(INDIRECT(C5,false),false)

by using Concatenate function, how we further write in the resulted cell because resulted cell shows the formula nor text.

For us to be able to help you better, please send the formula you use.

Just perfect! Thanks!

Is that possible to use indirect function to dynamically change the row number i.e. =INDIRECT($A$4&»!C31″), =INDIRECT($A$4&»!C32″) and so on.

You can use the formula below:
=INDIRECT(A4 &»:C31″)

I get #ref! error when doing this. If I take the : out then it returns a value but does not increment when I try to cascade the formula. But even with the : in place it does not increment like the original question asked about.

I have a small problem
in cell A1 — birthdate 01/01/2010
in cell B1 — =A1 : 01/01/2010
when I try with indirect I get the number instead of a date format

My goal is put in one cell indirect bithdate + birthplace
A1 & » » & A2

Thanks in advance.

I hope you have a great holiday, and looking forward to your fresh look at this issue

If you want the date in American format, use «MM/DD/YYYY».

Employee sheet details
Employee ID Group Name Machine Name Uniq ID Start Date End Date NumberOfAssets Machine Added to Domain
8002 IT Navaneeth.Sarvamanya nsarvamanya 8002-nsarvamanya — — 2 Y
8016 Engineer Suraj Bhasin sbhasin 8016-sbhasin — — 3 Y

Inventory sheet details
Type Model # Serial # Uniq ID Procurment Date End Date Hardware Condition Status
Laptop Official Z930 1E137603H Z930-1E137603H — — Available
Laptop Official Z930 3E099576H Z930-3E099576H 01-06-2014 31-05-2017 Lost

AssetLog sheet details

Start Date End Date Asset Employee Name Remarks Hardware Condition
01-02-2013 — Z930-1D094026H 8001-achhabra Working

Issue in the formulae
ActiveCell.Value = «=INDEX(Inventory!$E$6:$E$264,MATCH(«»Management»»&»»Z930*»»&»»Available»»,INDIRECT(«»Employee!»»&(«»c»»&ro))&Inventory!$E$6:$E$264&Inventory!$I$6:$I$264,0))»

ro is the variable which is row number which is specified; ro is not getting resolved hence I am getting #Name can you suggest me how to solve this issue?

Help! What is wrong with this formula?

=(COUNTIFS(‘Prod — Resolved’!(INDIRECT(«B3:B500″)),»1 — Critical»))

I’m trying to count the number of cells on the worksheet named Prod — Resolved, in the range B3 to B500, where the value is «1 — Critical».

Please try this formula:
=(COUNTIF(INDIRECT(«‘Prod — Resolved’!B3:B500″);»1 — Critical»))

I need your support. I have 3 drop down list where I have used indirect functions where box B depends on box A & box C depends on Box B and this have to work from A to C instead. I was able to lock A if is there any information on B ( I mean, box A not allow to filter only when box B is empty)
My concern is that I’m not able to lock box B for selection if the box C has information.
I would appreciate your support.

Hi I am creating a report spread sheet with a YES or NO box. If the box has YES in it I want he workbook to open another sheet or if NO then stay on the same sheet, is this possible.
Cheers Steve

«For example, you can use the following array formula (remember it requires pressing Ctrl + Alt + Enter)»

Ctrl+Alt+Enter . I don’t think so.

Of course, it’s CTRL+SHIFT+ENTER. Don’t know how Alt could sneak in. Thanks for catching it!

i want to indirect to another sheet but show the rows that have specific criteria

I am working on a calculation sheet where i have three different set of inputs and values for the three types of sub categories for example: I have a fruits business where i sell apple, orange, banana. All the three fruits have a different sales and purchase prices and so on. I have created a drop down list for the tree fruits and selected a fruit. As i have selected one fruit i wanted to display the respective calculations in the below cells. If I again change the input the values in the drop down the displayed values below should change accordingly. Can this be possible?

Thank you in advance.

hi,
how can i get the value of specific cell value of workbook that when it closed with indirect(without VBA)?

Thank you for the above information. It looks like I am doing this wrong by not using named ranges but I would like to ask anyways.

I’m working on a project that requires a separate «data» workbook and a number of «template» workbooks that are applied to the data workbook to create new user workbooks on the fly. My question is about using indirect to point to tables.

In the template workbooks I have a number of formulas that are pointing to the data workbook. When I create a merged user workbook by adding the template workbook to the data workbook, I’m am using VBA to edit out the file pointers to the data workbook so that the new workbook will not be reaching out to the original data workbook, becoming self contained.

Specifically the template workbook has the data validation list that uses Indirect to successfully to point to the data workbook:
=INDIRECT(«Data.xltm!tblContacts[Name]»)

After the worksheet is copied to the data workbook the edited Formula1 value is:
=INDIRECT(«tblContacts[ContactName]»)

However I’m getting a 1004 error on this code when I try to update the cell:
Cell.Activate
With Cell.Validation
.Delete
.Add Type:=xlValidateList, Formula1:=CellAfter
End With

i have a doubt in ms excel. In a column there are many cells in that column i want to take uncoloured cells from that column trough any equation. would you please help me to do it.

I am not sure exactly what «take uncoloured cells from that column» means. If you want to count uncolored cells, you can find a solution in this turorial (please see comment 47):

I have a drop down box at the top of «summary» worksheet that has the names of all the other worksheets in the workbook. In a later cell, I am trying to use INDIRECT to reference a cell on the sheet that comes from the drop down box, but I can’t figure it out. (all the other sheets are formatted the same, so the data I’m looking for is always in the same cell) This way when I select what worksheet I want (from the drop down box), the data automatically fills in down the summary sheet.
Latest attempt: =INDIRECT(«‘»&A1&»‘!»D10)

I am trying to use indirect to execute a DDE command based on variable. the original command is =’MT4’|HIGH!EURUSD

I want to create that command in a a cell then execute it in another cell.

many thanks for refering to my Excel-Translator.de in your post 🙂

I was badly looking for that function
Really thx

Hello Miss, i am trying to use indirect function for the file that is closed but it dose not work unless file is open can you help. filename Account.xlsx DATA:
A5 = F:DATAINVOICES, A6 = 1385_02/14/2015, A7 = Basicinvoice, A8 = $i$37
FORMULA: C1 = =INDIRECT(«‘»&A5&»[«&A6&».xlsx]»&A7&»‘!»&A8)

I am afraid this cannot be fixed. When an Indirect formula refers to another Excel file, it must be open, otherwise you will get the #REF! error.

How to do the formuala to use in another workbook indirect function when will drag down , sheet number changed and the data changed.

I have your product and love it. Use Merge Tables but have not had cause to explore other tools. Now I have issue where formulas turn to reference if rows are deleted after Table Merge in tab that is reference. Tried absolute and not success. Tried using Indirect Function which work for deletion of reference ROW issue but it doesn’t let me drag formulas down page to populate my data for export. Was trying CHAR AND ROW FUNCTIONS but unable to make ASCII character for AA, which would be 65,65. It seems like I’m missing a simple answer. Any help would be appreciated.

I am sorry it’s hard to determine the cause of the problem without seeing your data. If you could post this question on our forum and attach a sample forkbook, our support team will try to help.

Copyright © 2003 – 2023 Office Data Apps sp. z o.o. All rights reserved.

Microsoft and the Office logos are trademarks or registered trademarks of Microsoft Corporation. Google Chrome is a trademark of Google LLC.

Источник

I believe you must have programming in your background: the way you speak of the problem implies it.

Excel takes a different way of thinking. Instead of looking at it as «take this and do that to it then present it here» you go the other way: «HERE is where the result goes and hidden in the cell behind that display is a formula that LOOKS to different places, finds what it needs, and operates on that to result in this displayed result.»

Believe it or not, that is a huge difference. As described, gns100 is dead on: you must use VBA to program a solution. Because Excel flat out does not do what you want; in particular, it will NOT move something from one place to another, not ever.

But there is wonderfully good news. You clearly have a formula whose performance you are happy with in Sheet1!C9 as the only steps you describe needing are those of moving of information into place for that formula to work and then moving its result back to Sheet2!C6 for presentation or some other further on thing. And then to realize it needs to do the next data ending up in D6, then another set in E6, and so on.

The answer then, is to forget all about moving information into place. Simply place the formula that is in Sheet1!C9 into Sheet2!D6. Do this by pressing F2 and copying the entire contents of the formula editor’s display, pressing Escape, going to Sheet2!D6, and finally pressing F2 to open the formula editor for that cell and pasting into it.

At this point, the formula will not give exactly the result you still see in Sheet1!C9. You want to then copy the CELL and paste it to the other cells you need a result in: D6, E6, and so on. But copy the cell, not the formula in the cell only the way you did in the paragraph above. This way the formula will change to use Sheet2!D4:D5, not C4:C5, and that is of obvious importance.

However, while you want that change to occur (so cells referred to on THIS page), you do not want it to change cell references for cells it refers to on the OTHER page. Those must stay the same as you copy from C6 to D6, E6, and so on. So you need to make their references «absolute» which is done by placing a $ before the column letter and the row number. Sounds obnoxious, but you only have to do it this one time. So enter the formula editor and make the edit «by hand» moving to each place and typing the $, or use your mouse to highlight each reference (the whole reference) and pressing F4. You’ll see that add the $‘s. Press Enter to save the work and exit the formula editor. Once this is done, you can copy the cell itself over to however many row 6 cells you need it in and it will work just as if it were still on Sheet1.

In other words, there is no need to do the work on Sheet1 and then transfer the result to Sheet2. Just leave Sheet1 as is, and let Sheet2 look to the same table of data its formula does but since it is a cell on Sheet2 that is looking, the result will be on Sheet2, exactly where you tell it to be. And the several/many further results are just in different cells (D6, E6, …) and happen in parallel instead of being done one step after another like in programming.

Nothing ever gets moved to make this physically happen. So no programming needed as Excel takes your request for results and performs the programmatic steps on its own in the background. It’s still «programming» but you interface with it like you are the «customer/end user» not like you are the programmer. (And instead of you being frustrated with the client’s demands and fantasies, Excel is frustrated with you!) This is the huge difference between Excel’s process model and that of programming.

I have an Excel Worksheet that has 2 sheets. Sheet 1 and Sheet 2.

Sheet 1 has the following info with samples being 1 or 0. This sheet is then filtered where Column D (Sample) is 1.

Sheet 1:

---------------------------------------------
|Column A|Column B  |Column C   |Column D   |
---------------------------------------------
|  ID   |   NAME    |   TYPE    |    SAMPLE |
---------------------------------------------
|  A012 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A013 |Brad Pitt  |   Agent   |   0       |
---------------------------------------------
|  A014 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A015 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A016 |Brad Pitt  |   Agent   |   0       |
---------------------------------------------
|  A017 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A018 |Brad Pitt  |   Agent   |   0       |
---------------------------------------------
|  A019 |Brad Pitt  |   Agent   |   0       |
---------------------------------------------
|  A020 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A021 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A022 |Brad Pitt  |   Agent   |   0       |
---------------------------------------------
|  A023 |Brad Pitt  |   Agent   |   1       |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   1   |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   0    |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   1    |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   0   |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   1   |
---------------------------------------------
|  A024 |Angie Jolie    |   Agent   |   1   |
----------------------------------------------

Sheet 2 has info where Column B should take the distinct name from Column B (Name) from Sheet 1 and then COUNT the number of Samples (which had been filtered earlier to show only 1s) and put that count in Column C in that same row of the name of that person (In sheet 2)

Sheet 2:

|Column A|Column B  |Column C   |Column D       |
---------------------------------------------------------
|  Line |   NAME    |   Count   |  Description  |
---------------------------------------------------------
|  1    |Brad Pitt  |       7   |Blah blah blah |
---------------------------------------------------------
|  2    |Angie Jolie|       4   |Blah blah blah |
---------------------------------------------------------

I’m sure this is possible.

halfer's user avatar

halfer

19.8k17 gold badges97 silver badges185 bronze badges

asked Mar 23, 2017 at 0:11

user1777929's user avatar

Formula for C2 of Sheet2 is:

=COUNTIFS(Sheet1!B:B, B2, Sheet1!D:D, 1)

You can copy/paste it all the way in your column C of Sheet2.

answered Mar 23, 2017 at 0:25

A.S.H's user avatar

A.S.HA.S.H

29k5 gold badges22 silver badges49 bronze badges

0

  1. 04-20-2011, 11:07 AM


    #1

    wisedave is offline


    Registered User


    Question Calculating from one sheet to another

    Hello,

    I have a spreasheet that hase 6 pages. The first page is a snapshot of figures from the next 6 pages.

    I would like the first page to auto calculate the sum of each of a single cell from the other five pages.

    So page one is total sales of widgets. Each other page is a particular colour of widget. I want the first page totals to calculate the total sales of each individual ‘colour of widget’ page.

    Is this possible to do?

    Thanks for all the help!,

    -Dave

    Last edited by wisedave; 04-24-2011 at 02:43 PM.


  2. 04-20-2011, 11:13 AM


    #2

    Re: Calculating from one sheet to another

    If the sum is located in the same cell of each of those pages, then you can use a 3D formula like so:

    =SUM(‘Sheet1:Sheet6’!A1)

    where A1 in Sheet1 to Sheet6 have the numbers to sum up in your summary sheet.

    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor’s reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ’s to see how.


  3. 04-20-2011, 11:15 AM


    #3

    Re: Calculating from one sheet to another

    Hi Dave…

    Something like…

    =SUM(Sheet2:Sheet6!A1)


  4. 04-20-2011, 11:28 AM


    #4

    wisedave is offline


    Registered User


    Question Re: Calculating from one sheet to another

    Quote Originally Posted by jeffreybrown
    View Post

    Hi Dave…

    Something like…

    =SUM(Sheet2:Sheet6!A1)

    What does the ‘!’ delineate?

    Cheers,

    Dave


  5. 04-20-2011, 11:44 AM


    #5

    Re: Calculating from one sheet to another

    The exclamation mark follows sheetnames so excel knows that you are specifying a sheet name… the single quotes (apostrophes) are used when the sheetname consists of words separated by spaces or special chars… so that it keeps it altogether as the sheetname reference.


  6. 04-20-2011, 12:44 PM


    #6

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    Quote Originally Posted by NBVC
    View Post

    The exclamation mark follows sheetnames so excel knows that you are specifying a sheet name… the single quotes (apostrophes) are used when the sheetname consists of words separated by spaces or special chars… so that it keeps it altogether as the sheetname reference.

    If I understand this right….I use the sheet name, not the sheet number? For example sheet two is named ‘Sales’, sheet two is names ‘Chargebacks’.

    Thx,

    Dave


  7. 04-20-2011, 12:52 PM


    #7

    Re: Calculating from one sheet to another

    Hi Dave,

    Yes that is correct. You use the sheet name.

    If Sales in the first sheet and Chargebacks is the last sheet and you want the sum of all cell A1s, then…=SUM(Sales:Chargebacks!A1)


  8. 04-21-2011, 07:53 AM


    #8

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    Quote Originally Posted by jeffreybrown
    View Post

    Hi Dave,

    Yes that is correct. You use the sheet name.

    If Sales in the first sheet and Chargebacks is the last sheet and you want the sum of all cell A1s, then…=SUM(Sales:Chargebacks!A1)

    Hello,

    I have multiple sheets. Would I use a ‘:’ between each page, then after the last page use ‘!’?

    Thanks for the help!

    -Dave


  9. 04-21-2011, 08:30 AM


    #9

    Re: Calculating from one sheet to another

    Let’s say you have 12 sheets plus the wrapup sheet.

    The 12 sheets are titled Jan — Dec.

    On the wrapup sheet

    1. Click in the cell where you want the formula
    2. Enter = Sum(
    3. Click on first sheet Jan and then cell A1
    4. Hold down the shift key and click on the last sheet Dec
    5. Now you should have =SUM(‘Jan:Dec’!A1)

    Note: Make sure all sheets are next to one another. In other words, the wrapup sheet should not be inbetween Jan — Dec.

    Another method is to name one sheet first and one sheet last and then ensure all sheets are inbetween.

    =SUM(First:Last!A1)

    From what I understand, the : tells Excel you are creating a range of addresses.

    Last edited by jeffreybrown; 04-21-2011 at 08:32 AM.


  10. 04-22-2011, 12:24 PM


    #10

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    Hello,

    Ok..I have had a go for some time now, but just seem to get this right. I have attached spreadsheet with some data on it (but customer names removed).

    What I want to do is have Sheet 1 that is labeled Wise Totals be a snap shot of total sales.

    The remaining sheets are where I need to harvest the numbers from. I need to have the ‘Totals’ and ‘Exam Reg Fees’ populate the appropriate fields on Wise Totals. (Note — there is no exam fee column for the IOSH sheet)

    Can a guru take a look and help me get this formatted properly? If I am leaving something out, please feel free to make adjustments to make a a bit better. If it makes a difference, I need to be able to add additional rows in the future.

    Thanks for all the help an input!

    Cheers,

    Dave


  11. 04-22-2011, 01:37 PM


    #11

    Re: Calculating from one sheet to another

    Hi Dave,

    Sorry but I don’t follow your posted spreadsheet. The initial request seemed to want to sum up across sheets, but the Wise Totals sheet seems to be taking individual totals from seperated sheets.

    Also, you have one sheet titled NEBOSH; however, on the Wise Totals sheets there are two types of NEBOSH — eLearning and/or Classroom.

    Some more explanation is required and what do you expect in the Wise Totals sheet? Please add some test data with the results.


  12. 04-23-2011, 04:21 PM


    #12

    wisedave is offline


    Registered User


    Red face Re: Calculating from one sheet to another

    Jeff,

    You bring up a good point about the eLearning vs classroom. I have updated the spreadsheet to include those as separate sheets.

    You are right in saying I need to take a total from each sheet and plonk it onto the first sheet.

    Is that possible?

    Thanks for the help!,

    Dave


  13. 04-23-2011, 07:12 PM


    #13

    Re: Calculating from one sheet to another

    Hi Dave,

    So if I’m reading this right, you want to take the total from each respective sheet and transfer that total to the Wise Totals per same sheet name.

    For the NEBOSH eLearning sheet, the last cell with a total for Course Fee is C33 which is 1,185.00.

    On the Wise Totals sheet in cell C6 use =LOOKUP(9.99999999999999E+307,’NEBOSH eLearning’!C:C)

    and for Wise Totals sheet in cell D9 use =LOOKUP(9.99999999999999E+307,’NEBOSH eLearning’!D:D)

    This lookup formula looks for the last cell and value within the specified column.

    Hopefully this formula will get you started for all the rest.


  14. 04-24-2011, 02:15 PM


    #14

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    Hey Jeff,

    This works great….I had a hiccup but figured it out.

    Many thanks!

    -Dave

    Last edited by wisedave; 04-24-2011 at 02:42 PM.


  15. 04-24-2011, 02:49 PM


    #15

    Re: Calculating from one sheet to another

    Glad it worked for you Dave.


  16. 04-24-2011, 02:58 PM


    #16

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    I am now trying to add an additional line on the front sheet, but have hit a road bump…..

    I added an ‘Exams’ line and am trying to integrate the same formula. I am getting a #NAME! error in the field.

    Any thoughts on this?

    Thanks for the direction

    -Dave


  17. 04-24-2011, 03:02 PM


    #17

    wisedave is offline


    Registered User


    Re: Calculating from one sheet to another

    Drop that last post….I got it right now!

    Awesome stuff….

    -Dave


  18. 04-26-2011, 02:52 AM


    #18

    Bilal Bashir is offline


    Registered User


    Post

    i have created a formula from a large data which returns tax of single person. When i enter the salary in one cell it returns the tax in another cell.
    Now i have a problem there are large number of employee in my list and i have to put the salary of each employee in the input cell and get the tax and then enter into the salary sheet
    IS THERE ANY FORMULA/SHORT CUT TO AUTOMATICALLY HAVE THE RESULT AGAINST EACH EMPLOYEE NEXT TO THEIR SALARIES.

    OR

    IS THERE ANY WAY THAT THE FORMULA CAN TAKE VALUES OF SALARY FROM THE SALARY SHEET FOR EACH EMPLOYEE AND RETURN THE VALUE OF TAX OF EACH INDIVIDUAL

    KINDLY HELP

    REGARDS,

    IN DESPERATE NEED


  19. 04-26-2011, 02:53 AM


    #19

    Bilal Bashir is offline


    Registered User


    Post Re: Calculating MANY from one FORMULA

    i have created a formula from a large data which returns tax of single person. When i enter the salary in one cell it returns the tax in another cell.
    Now i have a problem there are large number of employee in my list and i have to put the salary of each employee in the input cell and get the tax and then enter into the salary sheet
    IS THERE ANY FORMULA/SHORT CUT TO AUTOMATICALLY HAVE THE RESULT AGAINST EACH EMPLOYEE NEXT TO THEIR SALARIES.

    OR

    IS THERE ANY WAY THAT THE FORMULA CAN TAKE VALUES OF SALARY FROM THE SALARY SHEET FOR EACH EMPLOYEE AND RETURN THE VALUE OF TAX OF EACH INDIVIDUAL

    KINDLY HELP

    REGARDS,

    IN DESPERATE NEED


  20. 04-26-2011, 02:58 AM


    #20

    Re: Calculating from one sheet to another

    Bilal Bashir
    welcome to the forum but, Your post does not comply with Rule 2 of our Forum RULES. Don’t post a question in the thread of another member — start your own thread. If you feel it’s particularly relevant, provide a link to the other thread.

    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs


You might have data in several Excel sheets that you need to be consolidated into one central location. Fortunately, you can to produce a Master Sheet with summaries and other totals from several different source sheets. 

In this tutorial, we will introduce how to calculate totals and get summary data from multiple sheets with similar structure.

Get data from multiple sheets into a master sheet in Excel

1. Calculate Total Based on Cell Reference

This article shows you how to get data from multiple sheets into a master sheet. Depending on the situation, this can be done by multiple methods. Let’s assume we have 3 sales sheets of 3 different stores: 1, 2 and 3 with similar formats below:

We want to add the Total sales of Store 1, 2 and 3 together and put the result in a “Summary” sheet. In this example, we can use a cell reference as in the following formula:

The problem with using the addition operator is that we can’t keep adding cells with more sheets.

2. Calculate Totals Based on a 3D Formula

Excel has a 3D formula to help us sum all data across multiple adjacent sheets. On a Summary tab, type =sum( in cell C2, select cell D9 on Store1 tab, hold the Shift key and select the rest of the tab. The formula bar shows:

=sum(‘Store1:Store3’!D9)

This 3D formula calculates the total of all D9 cells in different sheets from Store 1 to Store 3.

This formula gives the results the same as using cell reference. See below:

Note when using this formula, the user must make sure to maintain the same order of the sheets. If any of the sheets in the middle of the sheet range (Store1 to Store3) is moved out of the range, that sheet will be excluded from the calculation. In the screenshot below, we see that when the Store2 sheet is moved to the right of the Store3 sheet, the Total sale value drops to 645.9 which is Store1 + Store2 sales only.

3.Gather data from multiple sheets using INDIRECT()

We can add data from multiple sheets into a summary sheet using INDIRECT() function. INDIRECT() function need us to store the name of the sheet explicitly.

=SUM(INDIRECT(C1&"!"&"D9"),INDIRECT(D1&"!"&"D9"),INDIRECT(E1&"!"&"D9"))

In the formula above, INDIRECT(C1&”!”&”D9″) gives us the total sales located at cell D9 on Store1 sheet, INDIRECT(D1&”!”&”D9″) gives us the total sales located at cell D9 on Store2, and so on.

This formula is better than the 3D formula because it does not depend on the sheet location. However, the formula above requires a list of all the sheet names.

As you have seen from this tutorial, gathering data from multiple sheets can be done in several different ways and there is no best solution. Depending on the situation, one can use 3D formula or INDIRECT() function. In some other cases, you can also use Data Consolidation to calculate the total.

Different problems have their own best solution. If you are stuck and want to get to the solution quick, ask your question to have it answered by an Excel expert in 20 minutes. They are available to help you 24/7 at the link to the right. The first question is free.

Like this post? Please share to your friends:
  • Excel calculate all worksheets
  • Excel calcium с витамином д
  • Excel calcium для собак состав
  • Excel calcium для людей
  • Excel calcium в таблетках