Reversing the order in a sumproduct

Tkeller

Board Regular
Joined
Jul 23, 2003
Messages
143
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello,

I am sure this has been asked before. What I am trying to do is to reverse the order for a sumproduct:

Sumproduct( A1:A3,B1:B3) == A1*B1 + A2*B2 + A3*B3

Instead, what I'm after is

Sumproduct( A1:A3, Reverse(B1:B3)) == A1*B3 + A2*B2 + A3*B1

Thank you!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
There is probably a superior way, but this works at least.

Code:
[FONT=Verdana]=SUMPRODUCT(A1:A3,INDEX(B1:B3,LARGE(ROW(B1:B3)-ROW(B1)+1,ROW(INDIRECT("1:"&COUNT(B1:B3))))))[/FONT]
 
Last edited:
Upvote 0
Here is my take on it:

=SUMPRODUCT(A1:A3,INDEX(B1:B3,N(IF(,,LARGE(ROW(B1:B3)-ROW(B1)+1,ROW(B1:B3)-ROW(B1)+1)))))

Note: This is an array formula; it has to be entered using Ctrl+Shift+Enter, not just Enter
 
Upvote 0
Here is a more compact version:

=SUMPRODUCT(A1:A3,INDEX(B1:B3,N(IF(,,ROW(B1)+ROWS(B1:B3)-ROW(B1:B3)))))

Note: This is an array formula; it has to be entered using Ctrl+Shift+Enter, not just Enter
 
Upvote 0
Well, I appreciate the formula, but my data is in rows. So what I need to do is to sumproduct a row with the reverse of another row. Its my mistake that I gave the example assuming columns. Please could you help me to convert your solution to one that handles rows? I tried to, but I am no expert!

Many thanks!
 
Upvote 0
Here is a row-handling version of the formula:

=SUMPRODUCT(A1:C1,INDEX(A2:C2,N(IF(,,COLUMN(A2)+COLUMNS(A2:C2)-COLUMN(A2:C2)))))

Note: This is an array formula; it has to be entered using Ctrl+Shift+Enter, not just Enter
 
Upvote 0
Does this standard-entry formula do what you want?

Excel Workbook
ABCDEF
1135435
22245
Reverse Sumproduct
 
Upvote 0
Wow. That is exactly what I needed. Thanks to all, I am really starting to understand some of these things.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top