# Variables within a formula

#### AndrewKent

##### Well-known Member
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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Have a look at the INDIRECT function.

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

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!).

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.

Brilliant, thanks mate.

Replies
3
Views
271
Replies
1
Views
324
Replies
3
Views
517
Replies
3
Views
690
Replies
6
Views
790

1,220,009
Messages
6,151,442
Members
451,028
Latest member
greekness1

### 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.

### Which adblocker are you using?

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

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