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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

PATSYS

Well-known Member
Joined
Mar 12, 2006
Messages
1,750
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

fayeglock

New Member
Joined
Aug 10, 2006
Messages
7
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,186,908
Messages
5,960,526
Members
438,482
Latest member
Iamatlulu

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
Top