+ Reply to Thread
Results 1 to 5 of 5

SUMIF or SUMPRODUCT or any formula for this data set?

  1. #1
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    SUMIF or SUMPRODUCT or any formula for this data set?

    Hi Experts! Needing some help here with my subpar formula skills.

    With a data set like this,
    Date Category Hours Complete
    1/1/2016 A 8 Yes
    4/1/2016 B 1 Yes
    4/1/2016 B 1 Yes
    4/1/2016 B 4 Yes
    5/1/2016 C 5 No
    5/1/2016 D 0.5 Yes
    5/1/2016 E 0.5 Yes
    5/1/2016 E 2 Yes
    5/1/2016 F 1.5 No

    What formula can be used, if I do not want any helper columns/rows nor do I want to use a pivot table, to achieve this aggregate table?

    Hours are summed, grouped by category on Rows, grouped by months on Columns, where complete = Yes
    Category Jan Feb YTD
    A 8 0 8
    B 6 0 6
    C 0 0 0
    D 0.5 0 0.5
    E 2.5 0 2.5
    F 0 0 0
    Total 17 0 17

    I can achieve it with a pivot table but the labels (text in cells, e.g. "YTD" and "Total") on the pivot table are not very customizable.

    Thanks!
    多么想要告诉你 我好喜欢你

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: SUMIF or SUMPRODUCT or any formula for this data set?

    If you have dataset A1:D10

    Try

    F2=IFERROR(INDEX($B$2:$B$10,MATCH(0,INDEX(COUNTIFS($F$1:F1,$B$2:$B$10),),0)),"") and drag down.

    G2=SUMPRODUCT((TEXT($A$2:$A$10,"mmm")=G$1)*($B$2:$B$10=$F2)*($D$2:$D$10="Yes")*($C$2:$C$10)) and drag towards the cells and down.

    Check the attached file.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,687

    Re: SUMIF or SUMPRODUCT or any formula for this data set?

    With heading in row 12

    in B13

    =SUMPRODUCT(($C$2:$C$10)*($D$2:$D$10="yes")*($B$2:$B$10=$A13)*(MONTH($A$2:$A$10)=MONTH(B$12)))

    the months in B12, C12 are Excel dates (01/01/2016, 01/02/2016) formatted as "mmm"
    Attached Files Attached Files

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: SUMIF or SUMPRODUCT or any formula for this data set?

    Thank you both Ankur and John! Maybe not to you, but they are both very impressive solution to me!

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,687

    Re: SUMIF or SUMPRODUCT or any formula for this data set?

    Thank you for the feedback and rep.

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

+ 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. Sumproduct formula with sumif?
    By aqalna in forum Excel General
    Replies: 1
    Last Post: 10-05-2016, 06:49 PM
  2. SUMPRODUCT/SUMIF formula?
    By jasont1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-16-2014, 11:17 AM
  3. [SOLVED] Bringing together SUMPRODUCT & SUMIF formula
    By BerniceMUA in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2013, 10:00 PM
  4. Sumproduct/sumif formula help please
    By simbalyon303 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-19-2012, 12:30 PM
  5. Sumproduct or sumif formula
    By vasto in forum Excel General
    Replies: 6
    Last Post: 08-24-2009, 03:06 PM
  6. Sumproduct, Sumif, or Array Formula?
    By ExcelQuestion in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2007, 07:16 PM
  7. [SOLVED] SumIf/SumProduct Formula Help
    By Jacinthe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-10-2005, 07:06 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