Average If (I think) Help

KhannyX

New Member
Joined
Apr 13, 2019
Messages
2
Hey guys,

Long time lurker, first time poster!

Need some help if I may, I'm running a dataset for tender airfreight costs for my business, got the results split by country of origin, by weight break (45kg,100kg etc), across 4 carriers and three service levels (Deferred/Standard and Premium)

I want to return an average cost by country for each service level, by carrier, so I can model that onto my forecast numbers for the 2019 year.

Data looks a bit like this:
view

view

view
ForwarderOrigin CountryService Level45kg100kg300kg500kg1000kg2000kg
Forwarder 1ArgentinaDeferredValue 1Value 2Value 3Value 4Value 5Value 6
Forwarder 2IndonesiaStandardValue 1Value 2Value 3Value 4Value 5Value 6
Forwarder 3United StatesStandardValue 1Value 2Value 3Value 4Value 5Value 6

<tbody>
</tbody>

What I need to do is get an average by carrier by country, across the weight breaks, hopefully to build an averages table that I can lookup into...open to suggestions on format but I have in mind:
DeferredStandardPremium
Origin CountryForwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4
Argentina
Australia
Bangladeah
Bangladesh
Brazil

<tbody>
</tbody>


What can I do to return that average number over those breaks by carrier? I was thinking of an averageifs, but cant seem to get my head around it! I was also thinking it may be an array index match match, but again I want to return the average across weight breaks and the match match wont do that...

Any help appreciated, I'm using latest excel (Office 365).

Please and thank you!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi & welcome to MrExcel.
With Master data


Excel 2013/2016
ABCDEFGHI
1ForwarderOrigin CountryService Level45kg100kg300kg500kg1000kg2000kg
2Forwarder 1ArgentinaDeferred101520253035
3Forwarder 2IndonesiaStandard404550556065
4Forwarder 3United StatesStandard707580859095
Master


Result sheet


Excel 2013/2016
ABCDEFGHIJKLM
1DeferredDeferredDeferredDeferredStandardStandardStandardStandardPremiumPremiumPremiumPremium
2Origin CountryForwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4
3Argentina22.5
4Indonesia52.5
5United States82.5
6Bangladesh
7Brazil
Sheet2
Cell Formulas
RangeFormula
B3{=IFERROR(AVERAGE(INDEX(Master!$D$2:$I$4,MATCH(1,(Master!$A$2:$A$4=B$2)*(Master!$B$2:$B$4=$A3)*(Master!$C$2:$C$4=B$1),0),0)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi & welcome to MrExcel.
With Master data

Excel 2013/2016
ABCDEFGHI
1ForwarderOrigin CountryService Level45kg100kg300kg500kg1000kg2000kg
2Forwarder 1ArgentinaDeferred101520253035
3Forwarder 2IndonesiaStandard404550556065
4Forwarder 3United StatesStandard707580859095

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Master



Result sheet

Excel 2013/2016
ABCDEFGHIJKLM
1DeferredDeferredDeferredDeferredStandardStandardStandardStandardPremiumPremiumPremiumPremium
2Origin CountryForwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4Forwarder 1Forwarder 2Forwarder 3Forwarder 4
3Argentina22.5
4Indonesia52.5
5United States82.5
6Bangladesh
7Brazil

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
B3{=IFERROR(AVERAGE(INDEX(Master!$D$2:$I$4,MATCH(1,(Master!$A$2:$A$4=B$2)*(Master!$B$2:$B$4=$A3)*(Master!$C$2:$C$4=B$1),0),0)),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

That is absolutely perfect!

I think I've been sat in front of it for too long today and started confusing myself!

Thank you so much Fluff, means I can get onto something else this evening now I've managed to get that done and formatted :)

Have a fantastic day!
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,571
Messages
6,131,482
Members
449,653
Latest member
aurelius33

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