ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Summing differences with multpile criteria (https://www.excelbanter.com/excel-worksheet-functions/197671-summing-differences-multpile-criteria.html)

TT

Summing differences with multpile criteria
 

I want to sum the difference between each row in 2 columns of data for each
case where row(i) in column A 0 and row(i) in column B is less than column A



T. Valko

Summing differences with multpile criteria
 
So which column should be subtracted from which column?

A-B or B-A

Try one of these:

A-B:

=SUMPRODUCT(--(A1:A100),--(B1:B10<A1:A10),A1:A10-B1:B10)

B-A:

=SUMPRODUCT(--(A1:A100),--(B1:B10<A1:A10),B1:B10-A1:A10)


--
Biff
Microsoft Excel MVP


"TT" wrote in message
...

I want to sum the difference between each row in 2 columns of data for
each
case where row(i) in column A 0 and row(i) in column B is less than
column A






All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com