# Sumif over two worksheets

#### gj80

##### New Member
Hi

I have two worksheets

Worksheet 1
List of suppliers and product codes, some products have 2 suppliers (over 2000 products)

Worksheet 2
List of supplier, product codes and quantity sold. Multiple product codes are listed with different quantities and suppliers.

What I would like to do is show on worksheet 1 next to the product code for the supplier the total sum of sold by product.

Example
Works sheet 1
Supplier Stock Code Total sold
ABC 123
DEF 456
GEH 789
IJK 123

Worksheet 2

Supplier Stock Code Qty Sold
ABC 123 5
ABC 123 5
IJK 123 3

I have tried a sumif but not all the details are pulling through.

Many Thanks

### Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

#### Tetra201

##### MrExcel MVP
Is this what you need?

=SUMIFS(Sheet2!C:C,Sheet2!A:A,Sheet1!A2,Sheet2!B:B,Sheet1!B2)

#### gj80

##### New Member
Is this what you need?

=SUMIFS(Sheet2!C:C,Sheet2!A:A,Sheet1!A2,Sheet2!B:B,Sheet1!B2)

It works perfectly thank you.

#### Tetra201

##### MrExcel MVP
You are most welcome.

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,164,279
Messages
5,836,363
Members
430,424
Latest member
ALHK022

### 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?

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