If Statements? Look-ups? What's the best approach?

CLG31415

New Member
Joined
Apr 28, 2016
Messages
10
I have multiple sheets in my spreadsheet, all named for each of the U.S. states. I'm trying to write a formula that will sum values on the corresponding state page once the user types in a state in cell A2. For example, I have states Alabama through Wyoming, I want to look through every state's sheet until I find Ohio (entered in cell A2) and I want to sum what's in Column L for Ohio. However, the state will not always be 'Ohio', so I do not want to hard-code the word 'Ohio' into my formula.

Is there an easy way to do this?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Yes. Read up on the INDIRECT function, which will help you to achieve what you want. :)
 
Upvote 0
@CLG31415:

You would be better off setting up a drop-down list in cell A2 with all the states -- to make your document more user-friendly and to avoid typos. This can be done through Data Validation.

Anyways, here is the formula for the desired sum:

Code:
=SUM(INDIRECT("'"&$A$2&"'!L:L"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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
Back
Top