# Countif to Sumproduct

#### Turbo68

##### Board Regular
I am trying to get a sheet to update counts from another workbook automatically. The countifs formula is working fine:

=COUNTIFS('G:\[shiplog.xls]Returns'!\$C\$1:\$C\$65536,">" & DATE,'G:\[shiplog.xls]Returns'!\$D\$1:\$D\$65536,A11,'G:\[shiplog.xls]Returns'!\$E\$1:\$E\$65536,B11,'G:\[shiplog.xls]Returns'!\$F\$1:\$F\$65536,C11,'G:\[shiplog.xls]Returns'!\$A\$1:\$A\$65536,">5999",'G:\[shiplog.xls]Returns'!\$W\$1:\$W\$65536,"")

What the problem is that I have to have that data workbook open to update my sheet, otherwise I get #VALUE errors. I know that I can use SumProduct but I can't get all my criteria to work.

I have this working but for some reason, it finds nothing when I add the rest of the criteria.

=SUMPRODUCT(([shiplog.xls]Returns!\$C:\$C>DATE)*([shiplog.xls]Returns!\$D:\$D=A10)*([shiplog.xls]Returns!\$E:\$E=B10))

Can someone assist in transposing this Countif to SumProduct?

Mike

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

#### DanteAmor

##### Well-known Member
Try this

 =SUMPRODUCT(([shiplog.xls]Returns!\$C\$1:\$C\$1000> TODAY())*([shiplog.xls]Returns!\$D\$1:\$D\$1000=A11)*([shiplog.xls]Returns!\$E\$1:\$E\$1000=B11)*([shiplog.xls]Returns!\$F\$1:\$F\$1000=C11)*([shiplog.xls]Returns!\$A\$1:\$A\$1000>5999)*([shiplog.xls]Returns!\$W\$1:\$W\$1000=""))

Note: I recommend using a row number as far as you have data, if you use the entire column the sheet can be slow.

#### DanteAmor

##### Well-known Member
You can use Alt + Enter to separate each line from the formula, that way it can look like this, the formula can be better understood and still working.

 =SUMPRODUCT(([shiplog.xls]Returns!\$C\$1:\$C\$1000> TODAY())* ([shiplog.xls]Returns!\$D\$1:\$D\$1000=A11)* ([shiplog.xls]Returns!\$E\$1:\$E\$1000=B11)* ([shiplog.xls]Returns!\$F\$1:\$F\$1000=C11)* ([shiplog.xls]Returns!\$A\$1:\$A\$1000>5999)* ([shiplog.xls]Returns!\$W\$1:\$W\$1000=""))

#### Turbo68

##### Board Regular
Thanks.... I was just going to post what I came up with finally and looks similar:

=SUMPRODUCT(('G:\[shiplog.xls]Returns'!\$D\$1:\$D\$65536=A10)*1,
('G:\[shiplog.xls]Returns'!\$E\$1:\$E\$65536=B10)*1,
('G:\[shiplog.xls]Returns'!\$F\$1:\$F\$65536=C10)*1,
('G:\[shiplog.xls]Returns'!\$W\$1:\$W\$65536="")*1,
('G:\[shiplog.xls]Returns'!\$C\$1:\$C\$65536>DATE)*1,
('G:\[shiplog.xls]Returns'!\$A\$1:\$A\$65536>5999)*1)

Thanks again DanteAmor!

Replies
10
Views
579
Replies
8
Views
146
Replies
6
Views
270
Replies
8
Views
199
Replies
9
Views
194

1,127,035
Messages
5,622,329
Members
415,892
Latest member
ChloeLM

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