+ Reply to Thread
Results 1 to 7 of 7

Alternate rows sumproduct

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Alternate rows sumproduct

    Hi,

    I got this set of data:
    (simplified, in actual could be several hundred rows)

    Production A | 10,000
    Distance A | 1,200
    Production B | 20,000
    Distance B | 1,300
    Production C | 30,000
    Distance C | 1,400
    Sum of Production | =row1+row5+row5
    distance | =((row1*row2)+(row3*row4)+(row5*row6))/sum of production

    My question is:
    without modifying data position, what is the most efficient formula to calculate distance?

    Thank you.

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

    Re: Alternate rows sumproduct

    please attach a sample excel file
    Samba

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

  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,139

    Re: Alternate rows sumproduct

    Assuning that your data start in A2:

    =SUMPRODUCT((MOD(ROW(B2:B7)-ROW(B2),2)=0)+0,B2:B7,B3:B8)/SUMPRODUCT((MOD(ROW(B3:B8)-ROW(B3),2)=0)+0,B3:B8)
    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
    Registered User
    Join Date
    01-02-2013
    Location
    Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Alternate rows sumproduct

    Quote Originally Posted by Glenn Kennedy View Post
    Assuning that your data start in A2:

    =SUMPRODUCT((MOD(ROW(B2:B7)-ROW(B2),2)=0)+0,B2:B7,B3:B8)/SUMPRODUCT((MOD(ROW(B3:B8)-ROW(B3),2)=0)+0,B3:B8)
    Thanks for your reply, Glenn. But still not solved yet.
    Here is the attachment of my problem. I hope this is clear enough.

    Edit:
    After second thought, maybe my question title is a bit misleading. The solution could be any formula, sumproduct is just the first one that pops in my head when I write this question.
    Attached Files Attached Files
    Last edited by spidolster; 11-02-2016 at 11:16 PM.

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,921

    Re: Alternate rows sumproduct

    Try this ...

    =SUMPRODUCT(($A$1:$A$5=A7)*$B$1:$B$5*$B$2:$B$6)/SUMPRODUCT(($A$1:$A$5=A7)*$B$1:$B$5)

  6. #6
    Registered User
    Join Date
    01-02-2013
    Location
    Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Alternate rows sumproduct

    Quote Originally Posted by Phuocam View Post
    Try this ...

    =SUMPRODUCT(($A$1:$A$5=A7)*$B$1:$B$5*$B$2:$B$6)/SUMPRODUCT(($A$1:$A$5=A7)*$B$1:$B$5)
    Hey, it works like a charm!
    You made it looks so easy. Many thanks!

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,921

    Re: Alternate rows sumproduct

    You are welcome.

+ 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. how to delete alternate rows
    By sanjay2210.msl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-13-2014, 08:55 AM
  2. Need To Refer To Alternate Rows
    By unpluggedmusic in forum Excel General
    Replies: 4
    Last Post: 10-14-2012, 11:44 AM
  3. Using Sumproduct function ( Time consuming - any alternate )
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-27-2012, 04:14 PM
  4. Sum of alternate columns & rows
    By kumawat_s in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-05-2007, 10:59 AM
  5. Printing Alternate Rows
    By LPS in forum Excel General
    Replies: 2
    Last Post: 07-17-2006, 01:50 PM
  6. moving alternate rows
    By ad in forum Excel General
    Replies: 3
    Last Post: 04-28-2005, 10:06 AM
  7. Add alternate rows
    By Teri in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-16-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