+ Reply to Thread
Results 1 to 10 of 10

Sum Product taking account of zeros

  1. #1
    Forum Contributor
    Join Date
    08-06-2012
    Location
    Brighton, UK
    MS-Off Ver
    MS Office 2021 and 2019
    Posts
    112

    Sum Product taking account of zeros

    cell is zero, then the SumProduct ignores that cell in the daughter sheet (NormData). The parent cells are in the sheet Raw Data; the daughter cells in NormData.

    I would appreciate help in adapting the SumProduct function to take account of when the parent cell is zero. Example spreadsheet ?Improving SumProduct Analysis? attached.

    At present, I generate a figure from derived cells in sheet NormData (derived from Raw Data) using SumProduct such as =SUMPRODUCT($J17:$NT17,$J$30:$NT$30) in cell C17 to G17 of NormData and have used it in col.B too except for the example cell B17. B17 has my failed attempt to do what I want. These cells if Cols B ? G (except B17) work fine, but doesn?t take account of when the parent cell is zero ? that is, that item is not actioned in my lifestyle.

    To be explicit:, I don?t want to use any of the cells in the Rows (such as Row17) of NormData where the original data in Raw Data Row17 is zero.

    I?ve tried using =SUMPRODUCT($J17*'Raw Data'!J17/'Raw Data'!J17:$NT$32*'Raw Data'!NT17/'Raw Data'!NT$32,$J$29:$NT$29) in NormData B17, but that fails. Note I divided by Raw Data J32 in an attempt to keep figures similar to the original SumProduct. However, this doesn?t work.

    Is there a solution please?
    Attached Files Attached Files

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum Product taking account of zeros

    If you ignore the zeros or not that does not matter in a SUMPRODUCT.
    The difference between the 2 sheets arises because the data is not the same.

  3. #3
    Forum Contributor
    Join Date
    08-06-2012
    Location
    Brighton, UK
    MS-Off Ver
    MS Office 2021 and 2019
    Posts
    112

    Re: Sum Product taking account of zeros

    Thanks for trying to help HansDouwe.

    Yes, I know the two sheets are different. I generate the NormData from the Raw Data sheet.

    I essentially wish to do a SumProduct in the NormData sheet, but where the corresponding cell in the Raw Data is zero - for example P17, then I do not want the SumProduct for that cell to be included in the total SumProduct generated.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum Product taking account of zeros

    Whether or not that 0 (and its corresponding value by which it should be multiplied) is included in SUMPRODUCT makes no difference to the result.
    After all, 0 times something remains nothing. And whether or not you include nothing in the sumproduct, it doesn't matter.

    In algebraic terms: Suppose A2 = 0. A1*B1+A2*B2 = A1*B1+0*B2 = A1* B1

    You think of a problem, but there is no problem.
    Last edited by HansDouwe; 10-14-2022 at 04:36 PM.

  5. #5
    Forum Contributor
    Join Date
    08-06-2012
    Location
    Brighton, UK
    MS-Off Ver
    MS Office 2021 and 2019
    Posts
    112

    Re: Sum Product taking account of zeros

    Apologies. I have not explained my problem clearly enough.

    The generated cell values in the NormData sheet are such that even when the Raw Data data is zero, there is a non-zero value - by virtue of how the NormData cell values are calculated: ((Raw Data cell value) - (Average for that column))/StdDev for that column. Hence, when I do a SumProduct for that Row and the col. constants (index values) in NormData row 32, such zero Raw Data cells will cause a value to be used in the SumProduct.

    However, I do not want any Product of the NormData and col. constants to be part of the SumProduct.

    For example, Raw Data cell P16 is 0. But NormData cell P16 is -0.5256 - the latter is used in SumProduct (=SUMPRODUCT($J16:$NT16,$J$29:$NT$29)) to generate the value in B16. I wish to not include that NormData cell P16 in the SumProduct. Is this possible somehow?

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum Product taking account of zeros

    This formula on sheet NormData in row 17 excludes the parts in SUMPRODUCT where in the sheet Raw Data in row 17 is a zero in the same place:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-06-2012
    Location
    Brighton, UK
    MS-Off Ver
    MS Office 2021 and 2019
    Posts
    112

    Re: Sum Product taking account of zeros

    That works exactly as I needed. Many thanks HansDouwe.

    I've never used the Filter function before. I must get familiar with it.

    Your help is much appreciated.

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

    Re: Sum Product taking account of zeros

    If you have FILTER, you are no longer using Excel 2010. Please update your profile now to reflect what you ARE using. If it's O365... tell us the version too and if you're on PC or Mac (see my profile for an example).
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  9. #9
    Forum Contributor
    Join Date
    08-06-2012
    Location
    Brighton, UK
    MS-Off Ver
    MS Office 2021 and 2019
    Posts
    112

    Re: Sum Product taking account of zeros

    Thanks. I had forgotten to update.

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Sum Product taking account of zeros

    You are welcome. Thanks for the feedback. I'm glad to help you.

    Please consider adding reputation to the answers of any helpers if you think the answer has earned it?
    This can be done by clicking on * Add reputation at the bottom left of the answer.

+ 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] Subtotal of time, should not taking into account the date
    By excelnabb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-22-2018, 11:32 AM
  2. Excell - Getting the average without taking into account zero and DIV/0
    By danfreiburg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2015, 10:51 AM
  3. [SOLVED] Find the discount taking into account the qty ordered
    By carmelindazzz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-18-2014, 03:41 AM
  4. Find Min Time taking 24hrs into account
    By kiktuo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-24-2014, 09:06 PM
  5. Excel not taking into account cells in formula
    By danwhitehouse in forum Excel General
    Replies: 17
    Last Post: 11-08-2011, 12:28 PM
  6. Taking into account lead times ...
    By Turvy86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2009, 02:25 PM
  7. [SOLVED] Taking in account additional rows
    By JB12 in forum Excel General
    Replies: 3
    Last Post: 12-27-2005, 02:10 PM

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