# Returning all values based on criteria

#### blueice2627

##### New Member
Hey Everyone, hope you're all doing well. Got a head scratcher of a question that feels easy, but just can't get my head wrapped around it.

I'll try to keep this simple (strap in because this description is going to be difficult)

I work in hotels, that'll probably help in conceptualizing what i'm doing

We have a group of hotels (30+) that i'm tracking pick up for the next 10 days on. So each day, i create a new sheet with a new table (all in one workbook, but multiple sheets named with date) and plot down the rooms occupied for the current day through 10 days out. Each property has a unique code, and i already have about 2 months of data on multiple sheets inputted this way (meaning, i would like to not have to change things if i don't have to)

I have created different charts to help visualize the hotels by brand and/or each hotel specifically so that we can better keep track of trends, but i have decided that i want to have the ability to group by county.

To do this, i started by creating a reference table that uses each properties unique ID and made another column with the county.

So, now i have a final table that I want to calculate a counties occupancy. On this table, when i come in for the day, i will enter a new line with today's date and would like the table to calculate the counties occupancy based on a county input and total all the hotels that are within that county using the numbers from another sheet based on an indirect formula to refer to the sheet for that day and total the rooms from that day.

I came across a sumproduct/sumif formula that i feel is the key = sumproduct ( sumif ( range , criteria , sumrange ) )

I have an indirect formula to direct excel to the sheet based on the date to know which sheet to look at for values to add, but what I can't figure out is how to insert the criteria. The table that defines the criteria looks like this:
 Hotel Code Region Hotel 1 West Side Hotel 2 West Side Hotel 3 West Side Hotel 4 North Side Hotel 5 North Side

I want a formula that will return Hotel 1, 2, and 3 if the region is set to West Side so i can insert that into the criteria to calculate for that region. Most regions will have 2+ hotels so the value returned needs to include all hotels in that region.

Sorry for the lengthy question and buildup. I'm guessing this will just be some sort of Index/Match kind of deal, but i'm having the biggest of brain farts this week it seems like.

Thanks!

### Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Never mind, got it figured out. Used the same method as above, but created a unique index match array list that updates based on region selected and puts it all in a named range.

Replies
4
Views
1K
Replies
4
Views
152
Replies
0
Views
279
Replies
1
Views
138
Replies
0
Views
470

1,217,437
Messages
6,136,615
Members
450,022
Latest member
Joel1122331

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