Find Average of Mileage Bands

nniedzielski

Well-known Member
Joined
Jan 8, 2016
Messages
590
Office Version
  1. 2019
Platform
  1. Windows
I have the following three cells, Column M is a formula that finds mileage bands based off column K.

I have a column M that has cost per mile, I want to create column N as "Mileage Band Average" that will check Column L, see what the mileage band is, then give me the Average of Column M that meets that criteria. I keep getting the correct answer in N2 when using AverageIFS, but it fails when i copy down. this is the formula im trying:

=AVERAGEIFS(M:M,L:L,"81-100",M:M,"<121")

1677184217503.png
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
can you post the data in a table or use the xl2bb add in so that forum users do not have to recreate the data?
 
Upvote 0
im very sorry

DISTANCE_IN_MILESMileage BandCost per Mile
1672​
1501-2000$ 2.01
1672​
1501-2000$ 2.01
935​
501-1000$ 2.16
935​
501-1000$ 2.16
935​
501-1000$ 2.16
87​
0-100$ 0.62
87​
0-100$ 0.62
289​
201-500$ 2.12
0​
0-100$ -
640​
501-1000$ 3.20
289​
201-500$ 2.12
640​
501-1000$ 3.20
0​
0-100$ -
289​
201-500$ 2.12
640​
501-1000$ 3.20
0​
0-100$ -
277​
201-500$ 3.10
640​
501-1000$ 3.20
130​
121-140$ 3.93
640​
501-1000$ 3.20
 
Upvote 0
Here is something, but i'm not sure it is what you want. Unless you want average per trip and not a weighted average per mile
Mr Excel Questions 9.xlsm
ABCDEFGHIJKLMN
1DistanceMileageCost Per Mile
28781-1000.620.62
38781-1000.620.62
46261-802.422.383333
56261-802.422.383333
6120-404.825.497
7370-403.385.497
8370-403.385.497
9370-403.385.497
10370-403.385.497
115141-6013.4113.41
125141-6013.4113.41
135141-6013.4113.41
145141-6013.4113.41
155141-6013.4113.41
16370-403.385.497
176561-802.312.383333
18360-403.475.497
19160-4010.575.497
20280-406.45.497
21140-4012.815.497
Sheet3
Cell Formulas
RangeFormula
N2:N21N2=AVERAGEIF($L$2:$L$21,L2,$M$2:$M$21)
 
Upvote 0
Solution
Here is the above based on your copy/paste data:
Mr Excel Questions 9.xlsm
KLMN
23DISTANCE_IN_MILESMileage BandCost per Mile
2416721501-2000$ 2.012.01
2516721501-2000$ 2.012.01
26935501-1000$ 2.162.81
27935501-1000$ 2.162.81
28935501-1000$ 2.162.81
29870-100$ 0.620.62
30870-100$ 0.620.62
31289201-500$ 2.122.365
3200-100 $ - 0.62
33640501-1000$ 3.202.81
34289201-500$ 2.122.365
35640501-1000$ 3.202.81
3600-100 $ - 0.62
37289201-500$ 2.122.365
38640501-1000$ 3.202.81
3900-100 $ - 0.62
40277201-500$ 3.102.365
41640501-1000$ 3.202.81
42130121-140$ 3.933.93
43640501-1000$ 3.202.81
Sheet3
Cell Formulas
RangeFormula
N24:N43N24=AVERAGEIF($L$24:$L$43,L24,$M$24:$M$43)
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,519
Members
448,968
Latest member
Ajax40

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