+ Reply to Thread
Results 1 to 8 of 8

sumproduct formula for horizontal data

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    sumproduct formula for horizontal data

    Hi,

    I have data arranged horizontally, like this

    Column A / B / C / D
    Row 1 Channel1
    Row2 Sales / Supplier Price / Return % / Margin %
    Row3 values
    And then the same columns repeat for channel 2

    I want to calculate a weighted average for all channels for the return %. I would need a formula multiplying the sales columns with the return% columns, summing up the values and dividing by the sum of the sales. I tried sumproduct but I don't get the correct result. Any ideas how to make it work?

    Thanks!
    Attached Files Attached Files
    Last edited by Jules Pop; 08-08-2014 at 05:17 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-13-2010
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2003; 2007
    Posts
    441

    Re: sumproduct formula for horizontal data

    Jules Pop, Good morning.

    Please, give us some example about the data you have and what results you expect to receive.

    You can attach too your excel file to easier things for who wants to help you.
    To attach click GO ADVANCED buttom on edit window and click MANAGE ATTACHMENTS button.

    I believe a lot of persons will help you.
    ...If my answer helped you, Please, click on. * Add Reputation (at left)

    Best regards.
    Marc?lio Lob?o

  3. #3
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: sumproduct formula for horizontal data

    I have uploaded a file. I need a formula in the yellow cells. Now I have there a regular weighted average formula but I need one that will automatically calculate the result if I introduce new columns. I tried sumproduct with conditions and with index match but it's not working. Maybe I shouldn't use sumproduct but some other formula?

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: sumproduct formula for horizontal data

    =SUMPRODUCT((B$2:J$2=N$2)*(B3:J3)*(D$2:L$2=P$2)*(D3:L3))/N3
    Try this formula and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: sumproduct formula for horizontal data

    Thanks, it works! But how come if you consider in the formula the entire row array (B - M) it doesn't work, but if you consider part of the array it works?

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: sumproduct formula for horizontal data

    it will not work if select entire row array, why because sales starts at Column B and ends at Column J, where as Returns starts at Column D and ends at Column L
    So for Sales (B$2:J$2=N$2)*(B3:J3) and for Returns (D$2:L$2=P$2)*(D3:L3) was taken in the formula
    if you =SUMPRODUCT((B$2:L$2=N$2)*(B3:L3)*(B$2:L$2=P$2)*(B3:L3))/N3 used this formula the answer would be "0"

  7. #7
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: sumproduct formula for horizontal data

    Thanks! So I have to consider the array from the start point to end point and not the entire array.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: sumproduct formula for horizontal data

    Quote Originally Posted by nflsales View Post
    =SUMPRODUCT((B$2:J$2=N$2)*(B3:J3)*(D$2:L$2=P$2)*(D3:L3))/N3
    You can actually get the same result with one of the conditions removed, e.g.

    =SUMPRODUCT((B$2:J$2=N$2)*(B3:J3)*(D3:L3))/N3
    Audere est facere

+ 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] Copying and pasting Horizontal Data to Horizontal cells
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2013, 01:14 AM
  2. Sumproduct with horizontal and vertical criterion
    By Will31 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2012, 09:59 AM
  3. [SOLVED] SUMPRODUCT help with horizontal arrangement.
    By r4square in forum Excel General
    Replies: 3
    Last Post: 10-19-2012, 06:53 PM
  4. sumproduct with horizontal line
    By tkuia in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2007, 04:49 PM
  5. Sumproduct and horizontal lookup
    By Gingit in forum Excel General
    Replies: 3
    Last Post: 06-12-2006, 08:10 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