+ Reply to Thread
Results 1 to 16 of 16

Using the Sumproduct

  1. #1
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Using the Sumproduct

    Hi.

    How can i convert the following formula into a sumproduct? T
    this formula is too lengthy and time taking.

    sheet step 2 - cell P93. the formula need to be automated. linked to sheet "weights".
    The data is aggregated in cell P93 by being multiplied by the weights.

    The cell P93 contains the aggregated value of group 42:
    4210
    4220
    4290
    from sheet Weights.

    Please find the enclosed workbook
    Attached Files Attached Files
    Last edited by jay.tee; 10-19-2021 at 04:16 AM.

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Using the Sumproduct

    P93 is blank on both sheets. The errors in the workbook have been pasted back as values; seeing the formula which produced those errors would be helpful.

    A clearer visualization of the source data; what logic or calculations should be applied, and what an expected result should be; and it's location; would all be helpful.

    Thanks.
    Pete

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Using the Sumproduct

    Agreed. The locations in your post do not match your file.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Using the Sumproduct

    1) Do you want weighing of items in each group from sheet "Weights"? then multifly their own values? i.e, 4210 = H80/SUM(H80:H82)=15160140119/28307219077=53.55%? then 53.55*125.5.
    Similar to 4220 and 4290, then sum all.
    2) Do you want to take the year factor into account? i.e, Q1-Q4 and 2018 with column H sheet "Weights", and Q1-Q4 and 2019 with column I?
    Quang PT

  5. #5
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    Apologies.
    the values error were mainly because I needed to add an IFerror to the formula. I had re-pasted the values.

    Yes bebo021999 you're quite correct in the first point..

    the formula is in K41 sheet step2.

    =K5*('C:\Users\jtahir\Downloads\[workbookname]Weights'!$H$80/SUM('C:\Users\jtahir\Downloads\[QGDP_ChainedLinking_Indicators.xlsx]Weights'!$H$80:$H$82))+K6*('C:\Users\jtahir\Downloads\[workbookname]Weights'!$H$81/SUM('C:\Users\jtahir\Downloads\[QGDP_ChainedLinking_Indicators.xlsx]Weights'!$H$80:$H$82))+K7*('C:\Users\jtahir\Downloads\[workbookname]Weights'!$H$82/SUM('C:\Users\jtahir\Downloads\[workbookname]Weights'!$H$80:$H$82))

    I want this to be automated with sumproduct.
    Example:
    group 42 - the formula should take all the codes starting from 42.. like 4210, 4220 and 4290 and aggregate them using the formula:

    [4210+ [4220]+[4290]
    [step2k5 * (weightsH80/SUM(weightsH80:H82))] + [step2k6 * (weightsH80/SUM(weightsH80:H82))] + [step2k7 * (weightsH80/SUM(weightsH80:H82))]
    [57.5]+[15.6]+[26.25]

    now for group 86 I have to make this equation 5 times as there are 5 items in group 82.
    I was hoping to loop thru the values so this could be automated.

    hope I'm clear.

    please see the enclosed updated

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Using the Sumproduct

    Column P "Q1 2019", do you want it link to sales2019 column (column I sheet Weigh)? or always link to column H sheet weight?

  7. #7
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    so 2018 data will have 2018 base. but 2019 will have 2018(H) as base year. and 2020 will have 2019(I) base year. all are linked

    2019 step 2 data in cell p5 will be multiplied by (weightsH80/SUM(weightsH80:H82). 2020 step 2 data in cell u5 will be multiplied by (weights of column I(2019data) in sheet weights). and so on.. 2021 later will have 2020 data when available

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Using the Sumproduct

    Try in K41:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    thanks a lot bebo021999 !
    This actually works but is quite a lot complex.
    any chance to make it any easy as I'm a beginner

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Using the Sumproduct

    VBA solution, I thinks. But I am not familiar with coding.

  11. #11
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    oh bebo021999!

    becuase i edited the data heavily this formula is not working for me in my master file.i tried renaming and changing the cell locations accordingly. but it returns the " " due to error

    is it possible for you to tell me what the arguments are doing?

  12. #12
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    apologies. i got it right! thanks!

    but what about the return value.

    so if the groups are only having 1 value in step 2 and no matches in the weights sheet. how can I return the same value from step 2. so that no calculation is needed and it returns the same value

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Using the Sumproduct

    Could you give an examle? which group in which row and what desired result is?

  14. #14
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    step 2 K95 - has gorup 44. this value as appears once in the table and is not found at all in the weights sheet should remain the same as 98.1050357157985 as K13

    see the updated workbook

  15. #15
    Registered User
    Join Date
    10-17-2021
    Location
    Pak
    MS-Off Ver
    2013
    Posts
    40

    Re: Using the Sumproduct

    hi bebo021999

    Any luck?

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Using the Sumproduct

    One of the problems is that some values in column A of the Step 2 sheet are numbers and others are text.
    I changed A4:A12 to text.
    I propose to add a column V to rows 4:88. This helper column could be populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The results for rows 99:120 are obtained using: =SUMIFS(V$4:V$88,$A$4:$A$88,A92)
    Note that I put the results in column V for comparison to the values in column K.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Sumproduct with multiple variants - Help! I'm a newbie to sumproduct
    By KIGeorge in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2019, 01:21 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] Use sumproduct to further parse a sumproduct calculation
    By Araise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2015, 08:17 PM
  4. Count SUMPRODUCT Members / Average of SUMPRODUCT
    By Shingaru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 03:59 PM
  5. Replies: 1
    Last Post: 05-19-2012, 02:54 AM
  6. Replies: 5
    Last Post: 04-20-2012, 08:54 AM
  7. Using a SumProduct Count to find a SumProduct Total?
    By XL021710 in forum Excel General
    Replies: 3
    Last Post: 02-18-2010, 08:31 AM

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