# sum based on codes in 2 columns

#### fayeglock

##### New Member
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
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
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.

Replies
2
Views
416
Replies
21
Views
842
Replies
1
Views
111
Replies
5
Views
132
Replies
12
Views
368

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.

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.

### Which adblocker are you using?

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

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