Sum Calculation using Reference values from other columns

supernova2008

New Member
Joined
Dec 21, 2018
Messages
3
ABCD
23352.34567
32230.5658
4576-1.72585
76452.52574
4527-3.41573
34821.24793
9541-3.82634
3155-6.16391
56583.92772

<tbody>
</tbody>

Need to calculate sum of nos. provided in column D (Range for calculation in column D should be from row no. of maximum in column A to row no. of minimum in column B and for corresponding negative values of column C.

please help
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
in this case :
Maximum value in column A = 95
Row no. of maximum value = 8
Minimum value in column B = 23
Row No. of minimum value = 3

So the sum with corresponding negative value between between Row no. 3 to Row no. 8 should be 2585+1573+2634 = 6792
 
Upvote 0
The following formula returns the expected result for the posted dataset:

=SUMPRODUCT(--(ROW(D1:D10)-ROW(D1)+1<=MAX(MATCH(MAX(A1:A10),A1:A10,0),MATCH(MIN(B1:B10),B1:B10,0))),--(ROW(D1:D10)-ROW(D1)+1>=MIN(MATCH(MAX(A1:A10),A1:A10,0),MATCH(MIN(B1:B10),B1:B10,0))),--(C1:C10<0),D1:D10)
 
Upvote 0
The following formula returns the expected result for the posted dataset:

=SUMPRODUCT(--(ROW(D1:D10)-ROW(D1)+1<=MAX(MATCH(MAX(A1:A10),A1:A10,0),MATCH(MIN(B1:B10),B1:B10,0))),--(ROW(D1:D10)-ROW(D1)+1>=MIN(MATCH(MAX(A1:A10),A1:A10,0),MATCH(MIN(B1:B10),B1:B10,0))),--(C1:C10<0),D1:D10)


Range is Dynamic......
 
Upvote 0

Forum statistics

Threads
1,216,487
Messages
6,130,944
Members
449,608
Latest member
jacobmudombe

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