Average multiple criteria and ranges

angel87

New Member
Joined
Oct 24, 2017
Messages
3
Hello, Im trying to write a formula that calculates an average for a location under a specific period.
I have to specify the start and end dates and also the location and then get the average.
With one location I was able to calculate the average using averageifs, but if there are multiple locations I don't know how to make it go calculate the average on the correct column. The data set is a few hundred columns long, so when I specify the location I need the formula to use it to refer to the correct column in the spreadsheet.
For example, the formula should return the following 2 results for the dataset at the below.
Start
End
Location
Average
2/1/2018
5/31/2018
C
4.25
8/1/2018
11/30/2018
D
6

<tbody>
</tbody>

Date
A
B
C
D
E
1/1/2017
5.00
2.00
6.00
6.00
6.00
2/1/2017
8.00
7.00
4.00
1.00
5.00
3/1/2017
5.00
9.00
8.00
9.00
6.00
4/1/2017
0.00
1.00
1.00
4.00
4.00
5/1/2017
9.00
8.00
4.00
4.00
4.00
6/1/2017
8.00
7.00
4.00
6.00
6.00
7/1/2017
1.00
7.00
1.00
0.00
7.00
8/1/2017
7.00
4.00
6.00
8.00
3.00
9/1/2017
5.00
3.00
6.00
4.00
0.00
10/1/2017
4.00
0.00
2.00
4.00
2.00
11/1/2017
6.00
6.00
3.00
8.00
9.00
12/1/2017
8.00
8.00
0.00
9.00
6.00

<tbody>
</tbody>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Sorry, just realized I have an issue with the years is used the example. The dates in the two examples should be in 2017.
Idk how to edit original post :(
 
Upvote 0
@angel87, if you could provide some actual ranges for us to work with, someone will definitely be able to help you. For instance, which range would the headers of your criteria (i.e., Start, End, Location, Average) be occupying (e.g., H1:K1, etc.)? Which range would the main headers (i.e., data, A, B, C, D, E) be in (e.g., A1:F1, etc.)?
 
Upvote 0
See if this works for you.
Excel Workbook
ABCDEFG
1StartEndLocationAverage
22/1/20175/31/2017C4.25
38/1/201711/30/2017D6
4
5DateABCDE
61/1/201752666
72/1/201787415
83/1/201759896
94/1/201701144
105/1/201798444
116/1/201787466
127/1/201717107
138/1/201774683
149/1/201753640
1510/1/201740242
1611/1/201766389
1712/1/201788096
Sheet
 
Upvote 0
THANKS AhoyNY!!!!! this is perfect
I always have problems with Index-Match combo, it is so useful...

Thanks again!
 
Upvote 0
You're welcome. Thanks for the feedback and welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

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