+ Reply to Thread
Results 1 to 16 of 16

Average of cells in colum C for rows which have a combination of values in colum A and B

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Average of cells in colum C for rows which have a combination of values in colum A and B

    Hello agian, I'm full of questions it seems

    I am wondering is there is a way to tell Excel to produce an average of certain column's cell values for rows which have a combination of values in column A and B.

    Please see excel file attached.

    I need an average of column's N cells for rows 1 to 9 because those cells all have 'Trial001' as a value in column A and P01 as a value in column B. I need averages of all unique combinations of values in column A and B.

    That is, I need an average of the cells in column N for rows which have Trial002 and P01, Trial003 and P01 and so on for all 75 trials.
    Then I need an average of all cells in column N for rows which have Trial001 and P02Pilot, Trial002 and P02Pilot and so on for all the trials.
    Then same for P02Pilot and so on for every value in column B (in this sheet goes until P18).


    I understand that I can do this manually by applying AVERAGE function, but I have many sheets like that and it would be very time consuming. Is there a way to tell excel to do this automatically for all rows with a unique combnation of values in columns A and B? That would save me weeks of work..weeks I really need!

    Thank you all kind folk!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,298

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Use AVERAGEIFS
    =AVERAGEIFS(N:N,A:A,P2,B:B,Q2)

    as shown in the sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,298

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Revised results layout.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Hi,

    You can use a Pivot Table.

    Attached is a version of your file with a Pivot Table.

    Hope this is helpful.

    Cheers
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Southward,

    what you've done is increadible, that is exactly what I need! However, I am not able to replicate this

    I tried selecting just one row before clicking on insert Pivot and tried selecting all three columns and the whole worksheet, but whichever way I try I keep on getting an error message, eg. one attached in a printscreen.

    Do you have any idea what am I doing wrong? Could you please tell me step by step like you would for a granny who has never used computers :D
    Attached Images Attached Images
    Last edited by Petrichor; 02-27-2017 at 08:21 AM.

  6. #6
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Awesome! Thank you soo much

    Just again, I need to take some time to try and figure out how did you achieve this, as I am struggling to get my head around the functions you use and so I am nnot sure how to apply this to a new data set. That is not to say you are not being clear, I am just an extreme dummy with excel.

    I will be back with questions after work :D

  7. #7
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Glenn!

    That's awesome! Thank you soo much

    Just again, I need to take some time to try and figure out how did you achieve this, as I am struggling to get my head around the functions you use and so I am nnot sure how to apply this to a new data set. That is not to say you are not being clear, I am just an extreme dummy with excel.

    I will be back with questions after work :D

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,298

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    I'm usually here for a while, most days: so ask away...

    Thanks for the Rep, BtW.

  9. #9
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Hi Petrichor,

    Sorry, I neglected to indicated the requirements for inserting a Pivot Table. All the columns have to have something. In your situation, I had to give all the columns between B and N a header.
    In the example I posted I just entered a letter as a header for all those in between.
    This acts as a bridge/connector to associate column A&B with column N so that Excel will work the data as a group.

    Cheers

  10. #10
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Southward,

    ok, so I have copied the values in column N to column C to not have columns in between. But I am not sure how to select function 'Average of Values' in the Values Box on the right? I automatically get 'Count of Values' chosen by default and do not seem to be able to cose any other function?

    See Attached.

    Thank you!! And sorry I am so useless at this. I should have went to some Ecxel courses clearly..
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    No, hold on, I worked it out :D So sorry and so thank you haha!

    Have a great day!

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,298

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Not sure who you're talking to...

    But.

    Great! I'm glad to have helped! If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as Solved.
    Last edited by Glenn Kennedy; 02-27-2017 at 10:27 AM.

  13. #13
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Glenn,

    sorry first I was talking to Southward. I still need to see if I am able to replicate Your solution, because it might actually be a more useful data layout for me. Will try taht shortly and once it Works will mark the thread as Solved.

    Also, sorry I did not realise I can add reputation after every single post, will do that!

  14. #14
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Glenn,

    so as I supected I am not capable to produce the results layout with the formula you gave. I am sure it is something very basic that I don't get and that is why innitiation of the formula is not allowed. This is what happens if I try:
    Attached Images Attached Images

  15. #15
    Registered User
    Join Date
    02-24-2017
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2016
    Posts
    13

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    Sorry that will not work as the image is not clear enough. Basically the error Message tells me that there is a problem with teh formula and Excel seems to think that I am not actually wanting to use a formula and therefore suggests that I type '=AVERAGEIFS(N:N,A:A,P2,B:B,Q2) because ' will make it clear that it is not a formula but a value. But I need a formula :/

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,298

    Re: Average of cells in colum C for rows which have a combination of values in colum A and

    The problem is that you're Norwegian. Replace , with ; also: you have no value in Q2 and P2. Better to open the sheet at Post 3 and work from there.

+ 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. need a macro if row is text is constant then other colum shd copy n paste in other colum
    By uttam.mothe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2013, 12:17 PM
  2. Formula Help matchin colum a with colum b to display colum c
    By dbe82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 10:11 PM
  3. Replies: 18
    Last Post: 01-30-2013, 09:46 AM
  4. [SOLVED] Colum count based ón values In colum a and b
    By 2001jesper in forum Excel General
    Replies: 16
    Last Post: 11-05-2012, 03:28 PM
  5. copy and paste colum K to colom R and skip filled cells colum R
    By jdrmer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2012, 10:30 AM
  6. How to shift range of values from a colum to another colum at a programmed cell.
    By lolypop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2007, 06:24 PM
  7. Replies: 3
    Last Post: 10-19-2005, 05:05 PM
  8. Check data on colum A and find match on colum b
    By Chris(new user) in forum Excel General
    Replies: 3
    Last Post: 03-20-2005, 01:07 PM

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