Sumifs by time

Rakeforms

New Member
Joined
Aug 4, 2020
Messages
5
Office Version
  1. 2011
Platform
  1. MacOS
Hi all,

I'm really struggling to crack a formula and hoping someone can advise.

I've downloaded my sales data over the last month - every transaction listed with date, time (to the second) and the value, and I am now trying to aggregate hourly sales to fit my staffing patterns.

I thought I had it with =SUMIFS(C:C,B:B,>11,B:B,<12) but it just gives me that annoying "there's something wrong, try =1+1=2, try an apostrophe if you don't want that!" type reply which is very useless...

In my sheet, column C is my transaction values, and B is the time. The plan being I'd go on to change "11" for D1, "12" for D2, and run through bar opening hours 11am to 10pm by hour, but I can't figure out what the problem with my formula is, or if its the best formula for the job. Any help would be really appreciated!

Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884
You are missing the quotes in the criteria

=SUMIFS(C:C,B:B,">11",B:B,"<12")
 

Rakeforms

New Member
Joined
Aug 4, 2020
Messages
5
Office Version
  1. 2011
Platform
  1. MacOS
Hi, thank you pgc01, for your quick reply. However, I'm still getting a returned value of 0.
 

Attachments

  • excel screenshot.jpg
    excel screenshot.jpg
    27.3 KB · Views: 5

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884
In your image column B has time values. That's not what your formula is testing, it's testing the numbers 11 and 12

For the time values try:

=SUMIFS(C:C,B:B,">11:00",B:B,"<12:00")
 

Rakeforms

New Member
Joined
Aug 4, 2020
Messages
5
Office Version
  1. 2011
Platform
  1. MacOS
Thank you again for your help pgc01, that did solve it.

However, I am trying to complicate things now, and want a third argument based on column D which gives the name of the day by date =text(A#,"ddd")

=SUMIFS(C:C,B:B,">11:00",B:B,"<12:00",D:D,"=Mon")

but it is returning 0 again. Can't work out where I am going wrong. Have tried a few edits to make it work but can't seem to. Any one able to point me in the right direction?

Thanks!
 

Forum statistics

Threads
1,141,316
Messages
5,705,703
Members
421,406
Latest member
kluna90

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
Top