COUNTIFS vs. SUMIFS: Sum of Verbal Phone Orders between 7:01am and 11:59pm

Manny74

Board Regular
Joined
May 6, 2016
Messages
92
Hi All,

I am having trouble creating a formula...

I need the sum of verbal phone orders between 7:01AM and 11:59PM....I counted 10 (data is below)

I started with the formula below, but maybe I should use SUMIFS? Or what formula can I use to get me the sum of verbal phone orders between 7:01AM and 11:59PM?




COUNTIFS (F:F,">0",D:D,">7:00AM",D:D,"<12:00AM")


<colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962;"> <tbody> </tbody>




BDEF
Order DateOrder TimePharm Orders Verbal Phone Orders
42/12/20196:48 AM11
52/12/20196:49 AM11
62/12/20196:54 AM22
72/27/20198:36 AM11
82/26/20199:34 AM11
92/26/20199:40 AM11
102/28/201910:09 AM33
112/13/20192:38 PM11
122/12/20197:00 PM11
132/5/20198:14 PM22
142/7/20193:33 PM90
152/20/201912:01 PM90
162/22/201910:50 AM90
<colgroup><col width="64" style="width: 48pt;"> <col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="3"> <col width="64" style="width: 48pt;"> <tbody> </tbody>
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hi,

You could test following formula :

Code:
=SUMPRODUCT(($C$4:$C$16>TIME(7,1,0))*($C$4:$C$16<TIME(23,59,0))*($E$4:$E$16))
Hope this will help
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,606
Office Version
365
Platform
Windows
How about
=SUMIFS(F:F,D:D,">7:00",D:D,"<24:00")
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
The Html codes did disrupt the formula ...

= Sumproduct(($c$4:$c$16 > time(7,1,0))*($c$4:$c$16 < time(23,59,0))*($e$4:$e$16))

HTH
 

Manny74

Board Regular
Joined
May 6, 2016
Messages
92
I forgot to mention, Verbal Phone Orders, should be greater than 0....I need sum of at least 1 verbal phone order or more, from 701am to 1159pm....
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,606
Office Version
365
Platform
Windows
Both formulae already do that.
 

Manny74

Board Regular
Joined
May 6, 2016
Messages
92
I see...Let me see if this one works.....

=SUMIFS(F:F,D:D,">7:00",D:D,"<24:00")
 

Manny74

Board Regular
Joined
May 6, 2016
Messages
92
I'm validating this formula.... =SUMIFS(F:F,D:D,">7:00",D:D,"<24:00")

It's mostly working, but in one scenario, it counted the order below, but the order time was 7:00am, so it shouldn't count it, but it did?

It should be counting orders after 7:00am....

BDEF
Order DateOrder TimePharm Orders Verbal Phone Orders
2/19/20197:00 AM11
<colgroup><col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="3"> <col width="64" style="width: 48pt;"> <tbody> </tbody>
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,606
Office Version
365
Platform
Windows
Check the exact value of that cell it's probably 7:00:01 or something similar.
to get round that try
=SUMIFS(F:F,D:D,">=7:01",D:D,"<24:00")
 

Watch MrExcel Video

Forum statistics

Threads
1,099,005
Messages
5,465,959
Members
406,456
Latest member
jmishra91

This Week's Hot Topics

Top