+ Reply to Thread
Results 1 to 3 of 3

Calculate Average of Column B, IF Column A has 2 criteria: >=Col G (AND) <= Col H

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Norfolk, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Calculate Average of Column B, IF Column A has 2 criteria: >=Col G (AND) <= Col H

    Hi there,

    I am struggling for some time now with what I believe s an AverageIf formula, and would appreciate any help.

    I have 2 columns of data:
    Column A = Wind direction
    Column B = Wind speed

    Columns G and H define the min/ max values that I need to look up in column A, in order to average the corresponding values in column B. Please refer to the attachment, which will help.

    My Calculation Problem:
    I am trying to average the wind speed between 2 criteria. For example, average Column B IF Column A is >=11.26 [col G] AND <= 33.75 [col H], and am struggling with getting the formula to work in column L.


    N.b. I am trying to analyse data as a 16-segmented compass, each of 360/16 = 22.5 degrees.

    I have tried the formulae below in cells L5 and L6, but cannot get these to work. Calcs are more likely to work for NNE to NNW, however there is more difficulty for N due to the overlap for >348 BUT <11, so this formula is likely to be different:

    '=AVERAGEIF(B3:B27,(($A$3:$A$27,">="&G5)+(COUNTIF($A$3:$A$27,"<="&H5))))
    '=AVERAGEIF(B3:B27,(IF(AND($A$3:$A$27">="&G6,$A$3:$A$27"<="&H6))))


    For reference, I have managed to do a frequency analysis for each of the 16 directions, which I thought would be quite similar to the problem above (e.g. for E, midpoint is 90, taking min as 78.76 and max as 25).

    I hope someone will be able to shed some light on my attempts!

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Calculate Average of Column B, IF Column A has 2 criteria: >=Col G (AND) <= Col H

    I would think AVERAGEIFS is what you are looking for:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but given the first pair of MIN and MAX, I don't really know how that will work.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Calculate Average of Column B, IF Column A has 2 criteria: >=Col G (AND) <= Col H

    Oops, I think I may have got that the wrong way around:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards, TMS

+ 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. [SOLVED] Get average of some cells of a column If criteria in a different column with vba not worki
    By capson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2015, 09:47 AM
  2. [SOLVED] calculate average in a particular column for every 100 degree increasein some other column
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2013, 06:44 AM
  3. Need to calculate average for a column based on moving start column
    By BonnD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-03-2013, 08:35 AM
  4. Replies: 4
    Last Post: 12-12-2012, 10:37 AM
  5. Replies: 8
    Last Post: 06-26-2012, 06:45 PM
  6. Calculate modified average based on criteria from other column
    By excelforum123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2011, 12:04 PM
  7. [SOLVED] calculate average in a column based on criteria in another column
    By sharon t in forum Excel General
    Replies: 2
    Last Post: 05-12-2006, 01:10 PM

Tags for this Thread

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