Alternative for Countifs when referencing closed file - multiple lines

Negligible

New Member
Joined
Dec 10, 2013
Messages
1
Hi. I've been going through the archives to look for an alternative to using "COUNTIF" as I am referencing a file that is 113 MB and would prefer never to open it again. There are a few suggestions I've seen in searching the archives like trying a combination SUM(IF) or ACOUNT but none work at the level of complexity that I've been using the "COUNTIF" function for. I've posted a sample of the code I've been using.

{=COUNTIFS(
'filelocation\[filename.xlsx]Sheetname'!$C:$C,"A",
'filelocation\[filename.xlsx]Sheetname'!$N:$N,"NO",
'filelocation\[filename.xlsx]Sheetname'!$CL:$CL,"YES",
'filelocation\[filename.xlsx]Sheetname'!$BT:$BT,"YES",
'filelocation\[filename.xlsx]Sheetname'!$F:$F,LEFT(RIGHT($A2,8),3)&" ",
'filelocation\[filename.xlsx]Sheetname'!$G:$G,RIGHT($A2,4))}

Can someone offer some insight into how I might be able to convert this so it will operate if the file is closed?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi and welcome to Mr Excel Forum

SUMPRODUCT works with closed workbooks.

Maybe something like this (UNTESTED)

=SUMPRODUCT(--('filelocation\[filename.xlsx]Sheetname'!$C$2:$C$1000="A"),
--('filelocation\[filename.xlsx]Sheetname'!$N$2:$N$1000="NO"),
--('filelocation\[filename.xlsx]Sheetname'!$CL$2:$CL$1000="YES"),
--('filelocation\[filename.xlsx]Sheetname'!$BT$2:$BT$1000="YES"),
--('filelocation\[filename.xlsx]Sheetname'!$F$2:$F$1000=LEFT(RIGHT($A2,8),3)&" "),
--('filelocation\[filename.xlsx]Sheetname'!$G$2:$G$1000=RIGHT($A2,4)))


Important: note that the formula uses definite ranges, rows 2 to 1000 (adjust to your real case), not references to entire columns.

For a complete explanation about SUMPRODUCT see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,286
Members
449,218
Latest member
Excel Master

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
Back
Top