SUMIFS wrong for one specific time frame.

Aravis

New Member
Joined
Mar 10, 2019
Messages
4
I am trying to make an excel sheet where I summarize values happening between different hours. So for hour 02:00 I want to summarize everything happening between 02:00-03:00. That would include time frames 02:00-03:00, 01:00-04:00 etc.

The values I currently have are the ones seen below, which are in a sheet called "People".

1.PNG
1.PNG
BCJ
2Start timeEnd TimeValue to be summarized
300:0001:0027.2172
401:0002:0027.3431
502:0003:0027.4698
603:0004:0027.5973
704:0005:0027.7255
805:0006:0027.8542
906:0007:0027.9835
1000:0000:0028.1132

<tbody>
</tbody>

I am trying to summarize these values in another sheet called "References PMV". I do this with the following formula in the I column (going from H1 to H10):
Code:
=SUMIFS(People!$J$3:$J$10;People!$B$3:$B$10;"<="&'References PMV'!H1;People!$C$3:$C$10;">"&H1)


The following is the result I get. As you can see the values are correct except for at 05:00. Here it looks like the value have been summarized twice, and I really can't understand why this happens. I have triedd with different values in the J column. I have tried with time frame 04:00-06:00 instead of 05:00-06:00 in the B and C columns above, I have tried with 05:00-06:00 in different rows. The value for 05:00 is always summarized twice. I am so confused.

HI
100:0027.2
201:0027.3
302:0027.5
403:0027.6
504:0027.7
605:0055.6
706:0028.0
807:000.0
908:000.0
1009:000.0

<tbody>
</tbody>

Does anyone have any suggestions as to what might cause this?
Or an alternative way of summarizing values for the different times so I can avoid the miscalculation?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I tried replicating this, but I don't get the same results.

Here's what I get...

00:0027.2172
01:0027.3431
02:0027.4698
03:0027.5973
04:0027.7255
05:0027.8542
06:0027.9835
07:000
08:000
09:000
09:00
0

<colgroup><col style="width:48pt" width="64" span="2"> </colgroup><tbody>
</tbody>

Comment - as your source data is shown to 4 decimal places, and many of the source values are a little over 0.1 apart from each other, it would be more helpful to show your results to the same precision, i.e. 4 decimal places, at least for the purposes of this thread.
You can always change the formating to something else once this problem has been resolved.
 
Upvote 0
This looks wrong

Code:
=SUMIFS(People!$J$3:$J$10;People!$B$3:$B$10;"<="&'References PMV'!H1;People!$C$3:$C$10;">"&H1)

You've left the worksheet name out of H1 on the second reference
Code:
=SUMIFS(People!$J$3:$J$10;People!$B$3:$B$10;">="&'References PMV'!H1;People!$C$3:$C$10;">"&'References PMV'!H1)
 
Upvote 0
Ah that could be it, I tried replicating it but just ignoring all the different sheet references, and doing it all on the same sheet.
 
Upvote 0
I reckon its more likely to be a rounding issue. I can replicate it if:

=People!B8>'References PMV'!H6

but still shows as 5:00. I added 0.000000000000001 to People!B8 and the sumifs produces results that you see.
 
Last edited:
Upvote 0
I think I have managed to solve the problem, though I don't understand how it makes a difference.

Under format cells - numbers: Originally all my hours were categorized as time of type 13:30. I changed the category to custome with type tt:mm. After that the calculations were magically correct.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

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