+ Reply to Thread
Results 1 to 7 of 7

Average function - mathematical exercise

  1. #1
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Average function - mathematical exercise

    Hi All,

    I have a mathematical challenge which I hope you smart people can explain to me.

    In attached excel file I have products A-D with sales quantity, revenue and the average revenue per sale. I have actuals and targets thereby I can calculate an index.

    My challenge is the yellow cell. My average index is less than index 102% in all 4 product categories, but my total is index 104%. How come this can be higher?
    As 72% of my quantity is in product A then I whould expect my overall average to be close to this level.

    And is it my formulas that are incorrect?

    My head is spinning here. I hope some can help.

    thanks
    Alexander
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,731

    Re: Average function - mathematical exercise

    You need a weighted average:

    =AVERAGE(IFERROR(L3:L6/M3:M6,""))

    ... if you have earlier than Office 365, confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: Average function - mathematical exercise

    that function will do the. Trick. Thanks!

    But mathematically I still don't understand it. I take a total average on actual and target and divide one with the other. The averages are a product of revenue divided by quantity. Isn't this already kinda a weight average of the sub-product mix? Shouldn't this work?

    It's been years since i had my math classes

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,731

    Re: Average function - mathematical exercise

    No, it shouldn't work, and it won't. Does this help you to see why?

    Excel 2016 (Windows) 32 bit
    L
    M
    N
    O
    P
    Q
    R
    11
    200
    300
    66.7%
    267
    400
    67%
    12
    200
    400
    50.0%
    200
    400
    50%
    13
    400
    700
    57.1%
    467
    800
    58.3%
    14
    58.3%
    Weighted Average
    15
    16
    O11
    =L11*400/300
    Sheet: Ark1

    Excel 2016 (Windows) 32 bit
    L
    M
    N
    O
    P
    Q
    R
    11
    200
    300
    66.7%
    200
    300
    67%
    12
    200
    400
    50.0%
    150
    300
    50%
    13
    400
    700
    57.1%
    350
    600
    58.3%
    14
    58.3%
    Weighted Average
    15
    16
    O12
    =L12*300/400
    Sheet: Ark1
    Last edited by AliGW; 08-14-2019 at 07:57 AM.

  5. #5
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: Average function - mathematical exercise

    yes and know. Your initial formula gave me a total average per sale index vs. target across all product groups - weighted.

    However, I have now come across a scenario B. Here my product D have zero in sales and with your formula the average revenue per sale, overall is 74%. As D is minor then it should have very little impact on my overall performance.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Average function - mathematical exercise

    Assuming that you have changed the values in D6 and H6 to zero, Ali's array entered formula yields 98.6% in cell N7, because the IFERROR function converts the #DIV/0 in cell L6 into a blank which is then ignored by the AVERAGE function.
    If this isn't the scenario of which you speak then please provide more details or, better yet, upload another file illustrating the scenario.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: Average function - mathematical exercise

    I think the solutions I have received will do. Thanks a lot!

    However, mathematically I still don't understand why it doesn't work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. INDIRECT function with mathematical operators
    By TheRobsterUK in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-29-2019, 12:52 PM
  2. Mathematical Function not working
    By FranktheBank in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-06-2016, 11:20 AM
  3. mathematical function
    By oscar5 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-15-2013, 06:26 PM
  4. Columbia student exercise, Monthly > Quarterly data by Macro exercise
    By alepenn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2011, 12:04 AM
  5. How to get this mathematical equation into a function?
    By Call in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2010, 02:44 PM
  6. Make UDF for Mathematical Sum function
    By phonon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2007, 01:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1