+ Reply to Thread
Results 1 to 4 of 4

Averaging data if cells in range meet criteria

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Australia
    MS-Off Ver
    Excel mac 2011
    Posts
    2

    Averaging data if cells in range meet criteria

    Hi,

    I'm reasonably new to excel and was hoping to get some help with a formula.

    Here is some sample data:

    Screen Shot 2013-04-24 at 3.39.37 PM.png

    What I'm hoping to be able to do is include the hour value in an average calculation if the cell in the previous column meets the "YES" criteria.

    So ideally, the average value from the sample data would be 6.

    Any help would be appreciated.

    Thanks

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Averaging data if cells in range meet criteria

    hi gobbledok, welcome to the forum. try to upload a sample Excel file next time. it's easier for us to test out. assuming data is from A2:J2, try:
    =AVERAGEIF(A2:I2,"yes",B2:J2)

    notice i intentionally start from A2 & end in I2 for range, but start from B2 & end in J2 for average_range.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Australia
    MS-Off Ver
    Excel mac 2011
    Posts
    2

    Re: Averaging data if cells in range meet criteria

    Thanks benishiryo!

    Apologies for the incorrect file attachment, I'll remember that for next time!

    I assume that by starting the average_range one column across from the range it does so for the entire selection? Would it then also work the same way if I was to start the range from A2 and the average_range from D2?

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Averaging data if cells in range meet criteria

    you're welcome. not really sure what you mean. but what it does is average the nth cell when the nth cell reads "yes". so if A2 (1st cell for range) reads "yes", it will average B2 (1st cell for average_range).

    so if your average_range starts from D2, then by all means do it. just ensure both ranges (range & average range) have same number of cells. if you start from A2:E2 for range, average_range would be D2:H2. do mark it as "Solved" if that does it. otherwise, attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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