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

Manny74

Board Regular
Joined
May 6, 2016
Messages
103
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

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
56,729
Office Version
  1. 365
Platform
  1. 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
103
Office Version
  1. 365
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

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
56,729
Office Version
  1. 365
Platform
  1. Windows
Both formulae already do that.
 

Manny74

Board Regular
Joined
May 6, 2016
Messages
103
Office Version
  1. 365
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

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
103
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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
56,729
Office Version
  1. 365
Platform
  1. 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,129,931
Messages
5,639,061
Members
417,067
Latest member
rohitbabshet

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