Sumifs with Three Conditions

desoriente

New Member
Joined
Dec 31, 2010
Messages
14
I need to sumif a column of numbers only if it meets three criteria and export the answer into another excel file.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
First Excel File (the final format I need):
A B C D
1 Date Begin Time End Time Total
2 12/1/2010 22:00 22:59
3 12/1/2010 23:00 23:59 (formula in D3?)
4 12/2/2010 00:00 00:59

<o:p></o:p>
Second Excel File (has the data to look up):
A B C
1 Date Times Numbers
2 12/1/2010 22:59 0.01
3 12/1/2010 23:00 0.01
4 12/1/2010 23:30 0.01
5 12/1/2010 23:59 0.01
6 12/2/2010 00:00 0.01
<o:p></o:p>
Both excel files are shorten here for simplicity. In realty, the second excel file’s Column A has the entire month of December, and Column B has every minute within a 24 hour period.

So, for example, I need a final total (sum) in D3 in the first excel file based on these conditions: In the second excel file, if Column C falls between the hours 23:00 and 23:59 (Column B) on 12/1/2010 (Column A), sum up those particular numbers, which would be 0.03. This is what I came up with, but to no avail.
<o:p></o:p>
=SUMIFS(C2:C6,A2:A6,"='J:\FirstExcelFile.xlsx]Sheet1'!$A$3",B2:B6,"=<'J:\FirstExcelFile.xlsx]Sheet1'!$B$3&=>'J:\FirstExcelFile.xlsx]Sheet1'!$C$3")

Nothing happens. Please help!
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
SUMIFS (like SUMIF etc) will not work with closed targets (implied by full path in your sample formula) and you will need to revert to the less efficient SUMPRODUCT/Array alternative

Assuming the full paths in your example are reversed incorrectly, ie formula is in First File not Second File [and thus B2:B6 etc should be fully qualified and not the criteria]

Code:
D3
=SUMPRODUCT(('J:\SecondExcelFile.xlsx]Sheet1'!$A$2:$A$6=$A3)*('J:\SecondExcelFile.xlsx]Sheet1'!$B$2:$B$6>=$B3)*('J:\SecondExcelFile.xlsx]Sheet1'!$B$2:$B$6=$C3),'J:\SecondExcelFile.xlsx]Sheet1'!$C$2:$C$6)

However you will far better served running an External Pivot Table with both Date & Time as Row Fields (the latter grouped by Hour) and Numbers as Data Field.
 
Upvote 0
edit: just noticed I copied the reference construct from your original and they are missing a bracket

References to:

Rich (BB code):
'J:\SecondExcelFile.xlsx]Sheet1'


should read

Rich (BB code):
'J:\[SecondExcelFile.xlsx]Sheet1'
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,004
Members
452,374
Latest member
keccles

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