• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Averages for Varying Weeks & Years|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Averages for Varying Weeks & Years|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Averages for Varying Weeks & Ye…
sp_PrintTopic sp_TopicIcon
Averages for Varying Weeks & Years
Avatar
Paul Benjamin
Member
Members
Level 0
Forum Posts: 84
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline
1
October 19, 2019 - 2:22 am
sp_Permalink sp_Print

Hi

I'm trying to compare the average Revenue & GP for specified Years/Weeks, I've tried using Index/Match but with no success. I need a formula that gives me the average for the Years Selected then the weeks selected. Any suggestions?

Many thanks

Paul

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
October 19, 2019 - 5:46 am
sp_Permalink sp_Print

Hello Paul,

See attached file for two different solutions.

For the Index/Match formula, you can read more information about the technique used in this article.
If you are not so familiar with using Pivot Tables, I can recommend this article to start with.

Avatar
Paul Benjamin
Member
Members
Level 0
Forum Posts: 84
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline
3
October 28, 2019 - 2:45 am
sp_Permalink sp_Print

Hi Anders,

 

Sorry for not replying sooner, but work took over,

Really great solution, but when I tried moving to a different position on spreadsheet I get a #REF! error?

I can not see what is causing the error, but only part of formula I do not understand is Match(1, what does the 1 do as I would normally use a cell ref?

Thanks

Paul

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
4
October 28, 2019 - 8:39 am
sp_Permalink sp_Print sp_EditHistory

Hello Paul,

Currently viewing your file from my tablet and don’t have full view or functionality, but will try to give some help anyway.

Update: I have now checked your file in Excel and can confirm that the named ranges were missing in the name manager. As soon as I created those named ranges the values shows up correct. The name manager does not allow % characters in the name, so in order to still use the "dynamic" approach using the INDIRECT() function I renamed the GP% column to GP_Percent (as spaces are not allowed either).

If you want to use the GP% as header then use absolute cell reference instead.
Current formula in cell B310:
{=AVERAGE(INDEX(INDIRECT($A310);MATCH(1;($B$305=$B$4:$B$295)*($B$306=$A$4:$A$295);0));INDEX(INDIRECT($A310);MATCH(1;($B$305=$B$4:$B$295)*($C$306=$A$4:$A$295);0)))}

New formula in cell B310 using absolute cell reference:
{=AVERAGE(INDEX($G$4:$G$295;MATCH(1;($B$305=$B$4:$B$295)*($B$306=$A$4:$A$295);0));INDEX($G$4:$G$295;MATCH(1;($B$305=$B$4:$B$295)*($C$306=$A$4:$A$295);0)))}

I believe the error is due to the INDIRECT($A307) reference, it requires that you have set a named range Occupancy for D4:D294, do create named ranges for E4:E294, F4:F294 and G4:G294 using the headers in row 3 as the name for each column. Or change so that you use the cell references instead.

The answer to your question about number 1 as lookup value in the MATCH formula is found in the blog article I linked to previously, check the section ”So, how does it all work?” https://www.myonlinetraininghu.....o-criteria

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Aislinn Mellamphy, Lynnette Altomari, Roy Lutke, Dieneba NDIAYE, Tucker Oakley, Natasha Smith
Guest(s) 12
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 202
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Sopi Yuniarti
sandra parker
LAFONSO HERNANDEZ
Hayden Hao
Angela chen
Sean Moore
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Forum Stats:
Groups: 3
Forums: 24
Topics: 6215
Posts: 27244

 

Member Stats:
Guest Posters: 49
Members: 31894
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.