Sumif Same Hour Hour

ajamess

Board Regular
Joined
Sep 13, 2016
Messages
92
If I have a list of Times in Column A and values in Column B. Can I perform a sumif on column B for times in a Certain hour in column A.

Something like:

=sumif(a:a,hour(a:a) = x, b:b)

Or I would need to do either a helper column that is =hour(a2) and drag down, or do sumifs(b:b, a:a, ">=" & time(x,0,0), a:a, "<" & time(x+1,0,0))
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You can use SUMIFS like this for times in hour 10

=SUMIFS(B:B,A:A,">=10:00",A:A,"<11:00")

adjust as required or you can put 10:00 in a cell, e.g. D2 and use this version


=SUMIFS(B:B,A:A,">="&D2,A:A,"<"&D2+"1:00")
 
Upvote 0
Try something like

=SUMPRODUCT(B2:B200,--(HOUR(A2:A200)=x))

where x is a desired hour expressed as a whole number like 3.
 
Upvote 0

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

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