+ Reply to Thread
Results 1 to 8 of 8

Excel Function Sumif/ Sumifs or Sumproduct

  1. #1
    Registered User
    Join Date
    03-01-2018
    Location
    Sydney
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    10

    Excel Function Sumif/ Sumifs or Sumproduct

    Hi all,

    I have a spreadsheet that looks similar to the one attached. I am unable to think of a way to get excel to summarize the product of units with the count under the coded items such as PPO-1, PPO-2, etc under each month. Is there a formula that can sum the product of units and the count and summarize it in the summary table based on their codes and month?

    Any suggestion will be of great help.

    Thanks

    Sontu
    Attached Files Attached Files

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    =SUM(IFERROR((OFFSET(Details!$D$7,,E$2,100,E$3)=$C8)*OFFSET(Details!$D$8,,E$2,100,E$3),)) CSE
    Attached Files Attached Files

  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 2403
    Posts
    44,174

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    Like the solution above, this is an array formula. but it avoids the use of the volatile OFFSET function, which can slow things down.

    =SUM(IF(IFERROR(MONTH(Details!$E$3:$NQ$3),0)=MONTH(1&Summary!E$4),IF(Details!$E$7:$NQ$47=Summary!$C5,Details!$E$8:$NQ$48)))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    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

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    OT
    Glenn,
    i find it funny (bad word, excuse my poor English) to use this here:
    volatile OFFSET function, which can slow things down
    arrays in post #2 are 12 times less, no data conversion, no problems with localization,
    besides, there is not any NOW() in the file, usedrange is not huge.
    All info concerning so called Volatile Functions is quite old. And I was taught to avoid using them. But they are fast, short and comps and Excel are very powerful nowadays.
    Don't you think so?

  5. #5
    Registered User
    Join Date
    03-01-2018
    Location
    Sydney
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    10

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    Thanks Tim and Glenn,

    Both the formulas are working to get the sum of counts of each code, however i was hoping if they could yield the sum of the multiplication result of the count with the units. For eg. for PPO-1 it will be the sum of the product of units under Specimens 2, 9, 10 and 12 with the respective counts, i.e. 20 x 5 (Specimen 2) + 10 x 1 (Specimen 9) + 10 x 4 (Specimen 10) + 10 x 8 (Specimen 12) = 230 against PPO-1 in Summary for January. Is this possible with a formula that can be dropped down to apply across and along?

    Sontu

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

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    Hi. This was not so easy.... Your original sheet is flawed. Open "original" and scroll to BQ 6 & 7. the data are in the wrong place. The risk of this happening was greatly increased by your introducing a number of empty rows, and then forgetting that they were meant to be empty. To prevent this from happening again, I deleted the three empty rows between the headers and the data. Also, since all of March's data was offset by one row, as a result of this mistake, I deleted March data. Jan and Feb are fine. I accidentally deleted your data validation, too (apologies for that). But I'm sure that you can put it back.

    Anyhow. A monster formula can do what you want. NOTE: The ranges in the first two INDEX statements are NOT the same as those in the 3rd and 4th INDEX statements. This was INTENTIONAL.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is an array formula.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

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

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    Mis-post removed by GK

  8. #8
    Registered User
    Join Date
    03-01-2018
    Location
    Sydney
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    10

    Re: Excel Function Sumif/ Sumifs or Sumproduct

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. This was not so easy.... Your original sheet is flawed. Open "original" and scroll to BQ 6 & 7. the data are in the wrong place. The risk of this happening was greatly increased by your introducing a number of empty rows, and then forgetting that they were meant to be empty. To prevent this from happening again, I deleted the three empty rows between the headers and the data. Also, since all of March's data was offset by one row, as a result of this mistake, I deleted March data. Jan and Feb are fine. I accidentally deleted your data validation, too (apologies for that). But I'm sure that you can put it back.

    Anyhow. A monster formula can do what you want. NOTE: The ranges in the first two INDEX statements are NOT the same as those in the 3rd and 4th INDEX statements. This was INTENTIONAL.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is an array formula.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Thanks Glenn. I realised the errors in the sheet after the post as it was prepared in a haste. I appreciate you taking the time to get this monster formula. It does the work.

    I have been trying to work with SUM/ SUMIF and SUMPRODUCT and could only get the worksheet to give me results multiplied by the count of the value i am looking. For instance; for PPO-1 it is yielding 950 (which is 190 x 5). I could get it to give 190 however it will yield #DIV error for values that do not exist. Attached a sample.

    Thanks
    Sontu
    Attached Files Attached Files

+ 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. [SOLVED] Excel Function SUMIF or SUMIFS
    By Sontu in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-13-2018, 12:52 AM
  2. month function in sumifs or sumproduct
    By oxcor in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2017, 06:11 PM
  3. Replies: 2
    Last Post: 06-21-2017, 06:32 PM
  4. NEED HELP WITH SUMIF/SUMIFS Function
    By mrjones074 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-18-2015, 05:33 PM
  5. To change function from SUMPRODUCT to sumifs
    By bines in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-02-2013, 06:32 PM
  6. Simple I thought - Sumif / Sumproduct / Sumifs solution perhaps
    By jigpadia in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2013, 07:50 AM
  7. sumif? sumifs? sumproduct? help....
    By moshmoshon in forum Excel General
    Replies: 1
    Last Post: 08-23-2010, 06:47 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