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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

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.
 

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 !!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,094
Messages
5,768,051
Members
425,451
Latest member
JohnBrooksBiddle

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