SUMIFS when data source is closed

MPBJR

Board Regular
Joined
Mar 28, 2007
Messages
145
After reading many threads I realize I can't use SUMIFS when the data source workbook is closed, but I just can't wrap my head around the SUMPRODUCT function, if that is what I should be using. I've posted my current SUMIFS formula below that works when the external data source is open.

I have 2 criteria it needs to check,
criteria 1-the date in the external source file column A needs to match the date in D2 of the new file
criteria 2-the shift number in the external source file column B needs to match the shift number in B5 of the new file

If those criteria match, I need the sum in the external source file column S divided by the sum in the external source file column AA


=IFERROR((SUMIFS('[\\folder\datasource.xlsm]SH 5'!$S$4:$S$4000,'[\\folder\datasource.xlsm]SH 5'!$A$4:$A$4000,D2,'[\\folder\datasource.xlsm]SH 5'!$B$4:$B$4000,$B$5))/(SUMIFS('\\folder\datasource.xlsm]SH 5'!$AA$4:$AA$4000,'[\\folder\datasource.xlsm]SH 5'!$A$4:$A$4000,D2,'[\\folder\datasource.xlsm]SH 5'!$B$4:$B$4000,$B$5)),"")

I'm hoping someone can help me wrap my head around this or at least point me in the right direction.

Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Re: Help using SUMIFS when data source is closed

Try...

=IFERROR(SUMPRODUCT('[\\folder\datasource.xlsm]SH 5'!$S$4:$S$4000/'[\\folder\datasource.xlsm]SH 5'!$AA$4:$AA$4000,--('[\\folder\datasource.xlsm]SH 5'!$A$4:$A$4000=D2),--('[\\folder\datasource.xlsm]SH 5'!$B$4:$B$4000=$B$5)),"")
 
Upvote 0
Re: Help using SUMIFS when data source is closed

=IFERROR((SUMPRODUCT('[\\folder\datasource.xlsm]SH 5'!$S$4:$S$4000,—('[\\folder\datasource.xlsm]SH 5'!$A$4:$A$4000=D2),—('[\\folder\datasource.xlsm]SH 5'!$B$4:$B$4000=$B$5))/(SUMPRODUCT(['\\folder\datasource.xlsm]SH 5'!$AA$4:$AA$4000,—('[\\folder\datasource.xlsm]SH 5'!$A$4:$A$4000=D2),—('[\\folder\datasource.xlsm]SH 5'!$B$4:$B$4000=$B$5)),"")
 
Upvote 0
Re: Help using SUMIFS when data source is closed

Thanks, that worked perfectly! Any chance you know of a similar formula that will give me an average of a range rather than the sum? The data would be in the same external workbook, just a different column range.
 
Upvote 0
Re: Help using SUMIFS when data source is closed

Thanks, that worked perfectly! Any chance you know of a similar formula that will give me an average of a range rather than the sum? The data would be in the same external workbook, just a different column range.

Which one -- post #2 or #3 ?
 
Upvote 0
Re: Help using SUMIFS when data source is closed

Thanks for the reply, I was able to figure it out.
Thanks again!
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,628
Members
452,661
Latest member
Nonhle

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