MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Help with Adding certain Time Intervals?


Posted by Cadderly on November 22, 2001 4:08 PM

Hello, here is a sample spreadsheet
A B
1 6:05 18
2 9:05 3
3 6:45 7
etc, etc

I need to Sum the Cells that are in the Range of 6:00-700am(ie 25). I tried using a Sumif statement, but was unsuccessful. Any help would be appreciated.

Thank you
Cadderly


Posted by Peter on November 22, 2001 10:49 PM

simple solution is to add a third column with a formula like if(AND(A1>=6:00,A1=<7:00,1,0)

then do a sumif(C1:C3,1,B1:B3)

the if statement checks your time and if it falls between the two times it show a 1 otherwise a 0

You may want to put the start and end time at in a cell so you can change them around as needed.

Hope this helps