Need some expert help: abt inserting names in formula

cpis0002

Board Regular
Joined
Jul 28, 2007
Messages
96
Hi, this is not just simply inserting defined names into formulas.
This is mainly for use between different worksheets.

So for example: if I have 52 sheets named: Week 1, Week 2, ..., Week 52.

And on a separate sheet I have the following:

Column A Column B
Week 1 ='Week 1'!SUM($B$3:$B$8)
Week 2 ='Week 2'!SUM($B$3:$B$8)
... and so on.

Is there a way so that in column B, I don't have to manually change the week number, but it will take the value from column A. Kind of like:
='A1'!SUM($B$3:$B$8)

I know this doesn't work, but I need something like it to work. Any ideas?

I am no good at all on Visual Basic
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
So you want, from column A through column B to go Week1, Week2, Week3, etc...?

If so, enter the following function into Column A then fill across.
=concatenate("Week ",COLUMN())
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
I think what you want is INDIRECT.

=INDIRECT("'" & A1 & "'!B3:B8")
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
I got it to work this way...didn't find any difference between the Concatenation() and good old ampersand operator. Strangely, I couldn't get indirect to work directly (no pun intended...)...
Book1
ABCDE
1TabConcatenationSumSingleFormula
2Week1'Week1'!$B$3:$B$866
3Week2'Week2'!$B$3:$B$81212
4Week3'Week3'!$B$3:$B$81818
5
6
Sheet1
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Sorry, lost something in the HTML.

Formula in Cell B2 is:
="'"&A2&"'!"&"$B$3:$B$8"
Formula in Cell C2 is:
=SUM(INDIRECT(B2))
Formula in Cell D2 is:
=SUM(INDIRECT("'"&A2&"'!"&"$B$3:$B$8"))

(Ampersand versions)

Note: my first failed attempt was something like Indirect(Sum(Week1!B3:B8)) but the sum wasn't working as part of the string inside indirect...that's what I meant about using indirect directly...). :LOL:
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Oops, my bad.:oops:

Missed the all important SUM.:)

=SUM(INDIRECT("'" & A1 & "'!B3:B8"))
 

cpis0002

Board Regular
Joined
Jul 28, 2007
Messages
96
Hey, thanks a million, been wanting to find out how for a really long time
:biggrin:
 

Forum statistics

Threads
1,186,168
Messages
5,956,337
Members
438,247
Latest member
UZev

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top