+ Reply to Thread
Results 1 to 6 of 6

Match criteria (year) and obtain averages and sums

  1. #1
    Registered User
    Join Date
    06-04-2019
    Location
    canada
    MS-Off Ver
    Office 365
    Posts
    14

    Question Match criteria (year) and obtain averages and sums

    Hi all,

    I have a dataset where I need to obtain all the costs for each year. As you can see from the attached example each year is present in different rows and columns. I need the average with standard deviation as well as sum of the cost for each year.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by student789; 10-04-2019 at 06:54 PM. Reason: simplified it

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Match criteria (year) and obtain averages and sums

    If it was in one column it would be easier. I would try that first but if there is a reason it has to be in three try this for the sum

    Please Login or Register  to view this content.
    and this for the average


    Please Login or Register  to view this content.
    where J3 is the result for the sum. If you put the sum in a different cell then change J3 accordingly. Do you really want the SD as well? Your spreadsheet indicates you're looking for that too. That might be a bit more difficult as you need to find the differnec between the average and the individual values then sum the squares (I think) I'll need to check my maths on that though if you really want it. it is was in one column it would be easier!!!
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    06-04-2019
    Location
    canada
    MS-Off Ver
    Office 365
    Posts
    14

    Re: Match criteria (year) and obtain averages and sums

    I actually have 200+ columns of dates & 2000+ rows of ids, so that formula might get too long. I was able to use conditional formatting to highlight all the dates in red as seen in the example. Is there maybe a way to highlight each adjacent cell (ie cost) for each highlighted date & get the sums & averages. Just a thought, probably there is a better way to achieve what I'm trying to do.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Match criteria (year) and obtain averages and sums

    J3=sumif(b2:h6,2016,c2:i6)
    k3=j3/countif(b2:h6,2016)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Registered User
    Join Date
    06-04-2019
    Location
    canada
    MS-Off Ver
    Office 365
    Posts
    14

    Re: Match criteria (year) and obtain averages and sums

    Great seems to work. Thanks!
    Last edited by student789; 10-05-2019 at 03:18 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Match criteria (year) and obtain averages and sums

    This is a different question altogether - please start a new thread for it. Thanks.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. create a formula that sums the total values if three columns match certain criteria
    By karlos911 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2019, 08:21 AM
  2. [SOLVED] index match year(cell) against year and second criteria
    By Ochimus in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-31-2016, 07:55 AM
  3. [SOLVED] Year-to-Date Sums and Averages with different start dates
    By rachelglusk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2015, 07:13 PM
  4. Replies: 4
    Last Post: 03-13-2015, 05:34 AM
  5. [SOLVED] Two criteria to match to obtain result from database?
    By samuelleach in forum Excel General
    Replies: 8
    Last Post: 02-05-2015, 01:07 PM
  6. Filtering and averages, sums
    By Cmorgan in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-07-2014, 07:05 AM
  7. [SOLVED] How to obtain Averages from a list of multiple items?
    By MadameJunk in forum Excel General
    Replies: 5
    Last Post: 10-07-2005, 06:05 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