ivansmashem
New Member
- Joined
- Jun 26, 2015
- Messages
- 2
Hi, Everyone. First time posting here because it's the first time in a while I've been stumped by something in Excel! Here is what I am trying to do (and you can PM me for full file where I completely lay out all formulas):
Background: I am using Excel 2013 on Windows 7, 64-bit.
I am trying to sum a range of numbers, in this example B2:D9, that are on a different worksheet by using the SUM() and INDIRECT() functions. So the easiest way to do this would be to just directly use only the SUM() function as shown here:
Note: Sheet1 is my current sheet on which I am entering this formula, and Sheet2 refers to the "different" sheet whose numbers I am trying to sum.
Using the code above, I have no trouble summing the numbers from a separate sheet, so I wouldn't expect the issue to be here. My next test is to make sure that INDIRECT() can be used with SUM(), as is shown here:
Note: F2 contains the Row number in Column B where I start summing numbers. G2 contains the Row number in Column D where I stop summing numbers.
The above also works with no problem. However, there seems to be an issue with the INDIRECT() function trying to access other sheets. I can confirm that this does normally work as long you don't have INDIRECT() nested in another function, such as SUM(), like I do above. However, even though both of the above work fine, the following does not:
Instead, this returns simply "#REF!" instead of the sum of the numbers on the second sheet.
Does anyone know why this does not work? Am I trying to do something incorrectly? If so, how should I go about doing this? The purpose for me trying to do it this way is that I need to interact with a range of data from a separate sheet that is dynamically determined when I run the formula. My actual project involves me using INDIRECT() as an input to the INDEX() function, but I have confirmed that the INDEX() function is working as it should, and that my issue is with INDIRECT(), and using SUM() is a much easier way of testing what is going on.
Thank you all very much for having taken the time out to read my first pickle of a situation! I very much appreciate the help, and I look forward to seeing your brilliant responses soon!
Best,
Josh
Background: I am using Excel 2013 on Windows 7, 64-bit.
I am trying to sum a range of numbers, in this example B2:D9, that are on a different worksheet by using the SUM() and INDIRECT() functions. So the easiest way to do this would be to just directly use only the SUM() function as shown here:
Code:
=SUM(Sheet2!$B$2:Sheet2!$D$9)
Using the code above, I have no trouble summing the numbers from a separate sheet, so I wouldn't expect the issue to be here. My next test is to make sure that INDIRECT() can be used with SUM(), as is shown here:
Code:
=SUM(INDIRECT("B"&$F$2&":"&"D"&$G$2))
The above also works with no problem. However, there seems to be an issue with the INDIRECT() function trying to access other sheets. I can confirm that this does normally work as long you don't have INDIRECT() nested in another function, such as SUM(), like I do above. However, even though both of the above work fine, the following does not:
Code:
=SUM(INDIRECT("'Sheet2'!"&"B"&$F$2&":"&"'Sheet2'!"&"D"&$G$2))
Instead, this returns simply "#REF!" instead of the sum of the numbers on the second sheet.
Does anyone know why this does not work? Am I trying to do something incorrectly? If so, how should I go about doing this? The purpose for me trying to do it this way is that I need to interact with a range of data from a separate sheet that is dynamically determined when I run the formula. My actual project involves me using INDIRECT() as an input to the INDEX() function, but I have confirmed that the INDEX() function is working as it should, and that my issue is with INDIRECT(), and using SUM() is a much easier way of testing what is going on.
Thank you all very much for having taken the time out to read my first pickle of a situation! I very much appreciate the help, and I look forward to seeing your brilliant responses soon!
Best,
Josh