Sumproduct or alternative

stagnut

New Member
Joined
Sep 27, 2007
Messages
24
Hi,
I have been using a sumproduct formula for some years, and although it works fine I was wondering if there was an alternative way of getting the same result.

In C8 copied down =SUMPRODUCT(($A8>=$A$3:$A$4)*1,($B8<=$B$3:$B$4)*1,($C$3:$C$4)) to show how many are in each hour

[TABLE="width: 195"]
<tbody>[TR]
[TD]Start[/TD]
[TD]Finish[/TD]
[TD]Staff[/TD]
[/TR]
[TR]
[TD]22:00[/TD]
[TD]04:00[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]00:00[/TD]
[TD]06:00[/TD]
[TD]28[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]21:00[/TD]
[TD]22:00[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]22:00[/TD]
[TD]23:00[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]23:00[/TD]
[TD]00:00[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]00:00[/TD]
[TD]01:00[/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]01:00[/TD]
[TD]02:00[/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]02:00[/TD]
[TD]03:00[/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]03:00[/TD]
[TD]04:00[/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]04:00[/TD]
[TD]05:00[/TD]
[TD]28[/TD]
[/TR]
[TR]
[TD]05:00[/TD]
[TD]06:00[/TD]
[TD]28[/TD]
[/TR]
[TR]
[TD]06:00[/TD]
[TD]07:00[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]07:00[/TD]
[TD]08:00[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Is there some problem or issue that is causing you to question it and look for other solutions?
SUMPRODUCT formulas are usually some of the more efficient formulas out there, so if it is working the way you want, I would just leave it be.
If the issue is you have huge amounts of data, so the performance might be slow, your best alternative may be to use a database solution, like Access or SQL.
 
Upvote 0
There isn't any problem as all works well. It was something I cobbled together many years ago to count the number of occurrences in a time period pre and post midnight, and as I was just looking at Sumifs I wondered what the better one would be.
 
Upvote 0
From what I have read in the past, I believe that SUMIFS is not any more effiecient than SUMPRODUCT.
So if it is working, there is probably no real incentive to change it.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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