sum based on codes in 2 columns

fayeglock

New Member
Joined
Aug 10, 2006
Messages
7
I have 2 sheets:

Log
A B C D
Paint c 8331 20.00
Clean 8210 50.00
Water c 8315 35.00
Paint 8331 10.00

Totals (this is what I want)
A B
8210 0
8315 35.00
8331 20.00

What I want is to look in the Log and total only those rows for the codes where a 'c' is in column B.

Thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Assuming your data in the sheet TOTAL is in A1 to A3.

In cell B1 of sheet TOTAL, type this formula:

=SUMPRODUCT(--(Log!$C$1:$C$100=$A1),--(Log!$B$1:$B$100="C"),(Log!$D$1:$D$100))

Copy down.
 
Upvote 0
Thanks so much

Assuming your data in the sheet TOTAL is in A1 to A3.

In cell B1 of sheet TOTAL, type this formula:

=SUMPRODUCT(--(Log!$C$1:$C$100=$A1),--(Log!$B$1:$B$100="C"),(Log!$D$1:$D$100))

Copy down.

Patsys - your formula worked beautifully. Thanks for your help !!
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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