chrisdols

New Member
Joined
Nov 7, 2013
Messages
3
Here's a challenge:

I'd like to sum the differences between two columns (B-A) but only for those rows where column B's value is greater than Column A's:

AB
165
277
357
458

<tbody>
</tbody>

So my desired formula would produce '5' for this array, summing the difference for rows 3 and 4 because they are the ones that satisfy the criteria.

I can't make 'sumif' work for me b/c I don't know how to make it seek a neighboring column for its criteria. I have a spreadsheet with hundreds of columns so it can't be just as simple as adding an additional column with an 'if' statement before summing them. I need the single formula to perform both steps.

Thank you,
Chris
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
65
77
572
585
44
1610
2715
formula for cell giving 2 in third column (cell D4)
=IF(C4>B4,(C4-B4)+MAX($D$2:D3),"")

<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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