+ Reply to Thread
Results 1 to 3 of 3

Averaging Multiple columns based on Weeknum compared to Month

  1. #1
    Registered User
    Join Date
    01-19-2011
    Location
    Georgia
    MS-Off Ver
    Excel 2013
    Posts
    7

    Question Averaging Multiple columns based on Weeknum compared to Month

    I'm stumped on this one.


    =AVERAGEIFS($H$3:$J$27,$G$3:$G$27,(TEXT(($G$3:$G$27*7)-6,"mmmm")=O3))

    This will be performed for every month so O changes for its chart as it is showing Monthly yield.
    • Column H, I and J are Averaged Yields.
    • Column G is Weeknum
    • Column O is Month as Text (IE July)

    What I need is where G = July, AVERAGE.

    Currently it returns #VALUE!

    The issue is clearly the Weeknum to Month comparison but I don't know of a way to make this work, TEXT((G3*7)-6,"mmmm")=O3 returns TRUE if used on its own but I need to find any/all instances where it is true.


    Thanks in advance.
    Last edited by zdonner; 08-15-2014 at 03:37 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Averaging Multiple columns based on Weeknum compared to Month

    There are two things wrong with this:

    1.) AVERAGEIFS requires all the ranges to be the same size, so you can't have the average range 3 columns wide while the criteria range is a single column

    2.) The criterion in AVERAGEIFS needs to be a single condition, not a range of values as returned by TEXT(($G$3:$G$27*7)-6,"mmmm")=O3

    Try an array formula like this

    =AVERAGE(IF(TEXT($G$3:$G$27*7-6,"mmmm")=O3,$H$3:$J$27))

    confirmed with CTRL+SHIFT+ENTER

    Note that if, for example, G10 meets the criterion then H10, I10 and J10 will all be added to the average calculation, I assume that's how you want it to work?
    Audere est facere

  3. #3
    Registered User
    Join Date
    01-19-2011
    Location
    Georgia
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Averaging Multiple columns based on Weeknum compared to Month

    You got it exactly right, thank you so much it worked like a champion.

+ 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. Averaging Data From Multiple Columns Based on Selection
    By jelarv in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-29-2014, 02:42 AM
  2. [SOLVED] Summing up and averaging multiple rows depending on week or month
    By Roxner in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-10-2013, 09:08 AM
  3. Need a Macro that Hides Columns Based on Dates compared to Now()
    By yassiada in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2013, 08:29 PM
  4. Replies: 0
    Last Post: 07-31-2012, 06:09 PM
  5. update date of the week/month compared to today
    By tbar05 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2012, 05:24 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