+ Reply to Thread
Results 1 to 9 of 9

Calculate average for multiple ranges for multiple criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Calculate average for multiple ranges for multiple criteria

    Hello,

    I would like to calculate average values from multiple different ranges with varying number of sizes for multiple criteria. I have:


    A B C D E
    1 Day Time Hour Temperature Average Temp.
    2 15.02.13 09:02:15 10 20,1 20,3
    3 15.02.13 09:02:45 10 20,5
    4 15.02.13 10:01:15 11 21,5
    5 15.02.13 10:02:15 11 21,7
    6 15.02.13 11:02:15 12 22
    7 15.02.13 11:02:15 12 22,5
    8 16.02.13 09:02:15 10 20,1
    9 16.02.13 09:02:45 10 20,5
    10 16.02.13 10:01:15 11 21,5
    11 16.02.13 10:02:15 11 21,7
    12 16.02.13 11:02:15 12 22
    14 16.02.13 11:02:15 12 22,5
    15 16.02.13 13:02:45 14 23,5

    I want to get average temperature for a same day (in column A) and same hour (in column C) automatically calculated and written in the first row (in column E) for the corresponding day and hour. Example: 20,1 and 20,5 for day 15.02.2013 hour 10 -> average 20,3 in E2. Can anyone please help me?

    Thank you!
    Last edited by cesareit; 04-05-2013 at 10:02 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculate average for multiple ranges for multiple criteria

    Did you looked at AVERAGEIFS function?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Calculate average for multiple ranges for multiple criteria

    thank you for your quick reply.

    I have found solutions to similar problems but could not understand howto use AVERAGEIFS function for my problem. Better to say, in the examples I found, the ranges are given manually into the function. However, the table is much larger than the simplified form here, there are 1000s of entrys... and the number for entries correspond to same day and hour are very different...
    Last edited by cesareit; 04-05-2013 at 10:08 AM.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculate average for multiple ranges for multiple criteria

    I think it would be better to upload a small sample workbook with some data to work on it...

  5. #5
    Registered User
    Join Date
    04-05-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Calculate average for multiple ranges for multiple criteria

    Hi,

    I uploaded the excel file as you requested, thank you...
    Attached Files Attached Files

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculate average for multiple ranges for multiple criteria

    I mean in E2 and copy down this formula.

    =AVERAGEIFS($D$2:$D$13,$A$2:$A$13,A2,$C$2:$C$13,C2)

    AVERAGEIFS works in Excel >=2007.

  7. #7
    Registered User
    Join Date
    04-05-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Calculate average for multiple ranges for multiple criteria

    i get: "the formula you typed contains an error highlighting "$D$13,$A$2" ...
    besides this syntax problem, this formula must be placed in the corresponding cells in column E automatically, since there are thousands of rows in the original table..

    Please help me !

    Thank you..
    Last edited by cesareit; 04-05-2013 at 11:17 AM.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculate average for multiple ranges for multiple criteria

    See the example,pls

    In Germany you must use semi colons as separators as we do in Greece. That's why the error....
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-05-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Calculate average for multiple ranges for multiple criteria

    thank you fotis! That worked like a charm!

    Regards

+ 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