Sum range with subtracting two columns

italy16

New Member
Joined
May 9, 2014
Messages
34
[TABLE="width: 500"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Row 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Nov 18[/TD]
[TD]Dec 18[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]New[/TD]
[TD]R[/TD]
[TD]Customer[/TD]
[TD]45[/TD]
[TD]57[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Old[/TD]
[TD]R[/TD]
[TD]Customer[/TD]
[TD]45[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Ok[/TD]
[TD]NF[/TD]
[TD]Customer[/TD]
[TD]24[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ok[/TD]
[TD]NF[/TD]
[TD]Customer[/TD]
[TD]12[/TD]
[TD]98[/TD]
[/TR]
</tbody>[/TABLE]

Hello - I'm trying to "Sum" the different b/w Col.'s E and D IF column B is equal to either "new" "old" "Ok" AND Col C is equal to "R" or "NF"

So for row 4, it would be if B is equal to OK and Col C is equal to NF, then take the difference b/w Col E and D (which is 86)

Thank you in advance
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

Assuming you meant Row 5, not Row 4, having the result of 86, and the extra Column D "Customer" is meaningless for this query:


Excel 2010
ABCDEFG
1Row 118-Nov18-Dec
22NewR455712
33OldR458944
44OkNF248965
55OkNF129886
Sheet6
Cell Formulas
RangeFormula
G2=IF(AND(OR(B2={"New","Old","Ok"}),OR(C2={"R","NF"})),E2-D2,"")


G2 formula copied down.
 
Upvote 0
[TABLE="width: 500"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Row 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Nov 18[/TD]
[TD]Dec 18[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]New[/TD]
[TD]R[/TD]
[TD]Customer[/TD]
[TD]45[/TD]
[TD]57[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Old[/TD]
[TD]R[/TD]
[TD]Customer[/TD]
[TD]45[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Ok[/TD]
[TD]NF[/TD]
[TD]Customer[/TD]
[TD]24[/TD]
[TD]89[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ok[/TD]
[TD]NF[/TD]
[TD]Customer[/TD]
[TD]12[/TD]
[TD]98[/TD]
[/TR]
</tbody>[/TABLE]

Hello - I'm trying to "Sum" the different b/w Col.'s E and D IF column B is equal to either "new" "old" "Ok" AND Col C is equal to "R" or "NF"

So for row 4, it would be if B is equal to OK and Col C is equal to NF, then take the difference b/w Col E and D (which is 86)

Thank you in advance

Maybe this:

=SUMPRODUCT(F2:F5-E2:E5,--(MMULT(--ISNUMBER(SEARCH(" "&B2:C5&" "," New Old Ok R NF ")),{1;1})=2))

Markmzz
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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