+ Reply to Thread
Results 1 to 5 of 5

Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

  1. #1
    Registered User
    Join Date
    12-13-2018
    Location
    San Francisco, CA
    MS-Off Ver
    Office360
    Posts
    3

    Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

    I'm using the following COUNTIF formula to count the number of occurrences of each depts from a list of depts:
    =COUNTIF(Sheet5!E:E,A3)

    What I need is to get the sum of column DU in Sheet5 for the rows returned from the COUNTIF.

    For ex: the COUNTIF returns a 7-hits for the Finance Dept and I want to sum column DU (Sheet5) for those 7 instances.

    I've been trying SUMIF and SUMPRODUCT with no luck and need some help.

    Unfortunately I'm too close to the trees and need insight from a different view.

    Please let me know if some sample data is needed.

    Any help is highly appreciated!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

    Sample data is always useful to see a problem in context, but try this:

    =SUMIF(Sheet5!E:E,A3,Sheet5!DU:DU)

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-13-2018
    Location
    San Francisco, CA
    MS-Off Ver
    Office360
    Posts
    3

    Re: Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

    Perfecto Pete!

    Thanks!

    I thought that was tried, but my statement must have been off.

    fwiw: I'm a big a believer in sample data as well, but I'm glad you were able to assist without it.

    Have a good one!

  4. #4
    Registered User
    Join Date
    12-13-2018
    Location
    San Francisco, CA
    MS-Off Ver
    Office360
    Posts
    3

    Re: Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

    A quick follow-up, I see how easy it is to get the Average with AVERAGEIF, but what about getting the median?

    It doesn't look like =MEDIAN(IF(Sheet5!E:E,A3,Sheet5!DU:DU) works. Am I missing something?

    Thanks!

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Need to sum values based on set criteria: SUMIF, SUMPRODUCT or something else?

    Thanks for the rep.

    Regarding your follow-on query, you need to do it as an array* formula, like this:

    =MEDIAN(IF(Sheet5!E$2:E$1000=A3,Sheet5!DU$2:DU$1000))

    *Note that an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual Enter. If you do this correctly, then you will see curly brackets { } around the formula when viewed in the formula bar, but you should not type these yourself. If you need to edit the formula, you must use CSE again.

    Note also that I have used a reduced range, as an array formula will use every cell in the range and thus can become a bit sluggish. You can copy the formula down in your usual way(s).

    Hope this helps.

    Pete

+ 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. Replies: 6
    Last Post: 11-03-2018, 04:50 AM
  2. Combine sumif/sumproduct or sumproduct with multiple criteria
    By sab128 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2018, 08:25 AM
  3. [SOLVED] SUMPRODUCT function count the Unique values based on Multiple criteria
    By savetrees in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2018, 04:03 AM
  4. [SOLVED] Sumif/sumproduct criteria based on integer portion only
    By carsto in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-28-2017, 05:37 PM
  5. SUMIF or SUMPRODUCT formula to SUM totals based on multiple criteria
    By relmasri in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-01-2016, 01:08 PM
  6. Summing values based on criteria (SUMIF issues)
    By notsamsnead in forum Excel General
    Replies: 4
    Last Post: 08-11-2014, 09:03 PM
  7. SUMIF based on certain criteria - and then subtract neg. values
    By Darlo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-20-2009, 10:09 AM

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