Flipping a sumproduct

ajmckenna

Board Regular
Joined
Oct 7, 2002
Messages
145
I have a sumproduct calculation problem.

is there a way to enter the second range backwards

ex. first number is in A1

Row 1= 10 20 30 40
Row 2 1 2 3 4

instead of sumproduct(A1:a4,B1:b4) result=300

I want a result of 200 or 10*4 +20*3 +30*2+40*1 without having to flip the order of row2

thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
=SUMPRODUCT(A1:D1,N(OFFSET(A2,0,COLUMN(A2)+COLUMNS(A2:D2)-COLUMN(A2:D2)-1,1)))


Addendum. If there are no empty cells in the range to reverse, use...

=SUMPRODUCT(A1:D1,N(OFFSET(A2,0,COLUMN(A2)+COUNT(A2:D2)-COLUMN(A2:D2)-1,1)))

which has one less volatile function.
This message was edited by Aladin Akyurek on 2002-11-01 17:40
 
Upvote 0
The formula in cell A6 below has no volatile functions, but uses the Morefunc.xll...
Book1
ABCDEFGHIJ
110203040
21234
3
4200
5200
6200
7
Sheet2

This message was edited by Mark W. on 2002-11-01 17:54
 
Upvote 0
Mark & Aladin
Thanks for you help I will either have the data I want to flip brought into a new range & do traditional sumproduct or use aladin's formula. I will have 12 variable inputs(as opposed to 4 (4,3,2,1) in my example) and it will be a rolling formula, also other people will use file to morefunc is not an option. I think one of these methods is the way to go thanks for all the help.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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