Variables within a formula

AndrewKent

Well-known Member
Joined
Jul 26, 2006
Messages
889
So I have my second question to the forum for today, I'm hoping this might be an easy one. I have worksheets for each day and I want a main "Total" page to simply sum up the values from three cells. However a drop down list in A2 determines which days I want to SUM...

Code:
=SUM(Monday!B3,Monday!E3,Monday!H3)

...how do I make "Monday!" a variable that looks at Total!A2 for the day I wish to SUM?

Andy
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
Have a look at the INDIRECT function.

If A2 = "Monday", =INDIRECT(Total!A2&"!B3") will return the value in Monday!B3, etc.
 

AndrewKent

Well-known Member
Joined
Jul 26, 2006
Messages
889
Perfect, that does exactly what I'm looking for. Is there another way of doing this? I achieved a similar result a while back but I can't remember how I done it (hence why I'm posting here!).
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
Perfect, that does exactly what I'm looking for. Is there another way of doing this? I achieved a similar result a while back but I can't remember how I done it (hence why I'm posting here!).

Not that I can think of. I think INDIRECT is the way to go here.
 

Forum statistics

Threads
1,171,968
Messages
5,878,539
Members
433,350
Latest member
horna

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