Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Need countifs forumla to analize in a time range

I have a spreadsheet that I need some help with having a count formula count events between the timeframes 00:00-5:59 AM, 6:00am-1:29pm and 1:30pm-11:59pm, but also while observing that K2:K2000 ="360" and F2:F2000 ="K". I've been playing with some countifs and sumproducts for a while and I'm not getting anywhere. Please help!

Thanks!

Last edited by coil222 : October 1st 13 at 05:07 PM
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default Need countifs forumla to analize in a time range

"coil222" wrote:
I have a spreadsheet that I need some help with having a count formula
count events between the timeframes 00:00-5:59 AM, 6:00am-1:29pm and
1:30pm-11:59pm, but also while observing that K ="360" and F ="K". I've
been playing with some countifs and sumproducts for a while and I'm not
getting anywhere.


A little light on details. I assume you want to count each time frame
separately. If times are in A1:A1000 and you do not require Excel 2003
compatibility, try:

=COUNTIFS(A1:A1000,"<"&TIME(6,0,0),K1:K1000,360,F1 :F1000,"K")

=COUNTIFS(A1:A1000,"="&TIME(6,0,0),A1:A1000,"<"&T IME(13,30,0),K1:K1000,360,F1:F1000,"K")

=COUNTIFS(A1:A1000,"="&TIME(13,30,0),K1:K1000,360 ,F1:F1000,"K")

If you require Excel 2003, or if the "times" include dates, try:

=SUMPRODUCT((A1:A1000<TIME(6,0,0))*(K1:K1000=360)* (F1:F1000="K"))

=SUMPRODUCT((A1:A1000=TIME(6,0,0))*(A1:A1000<TIME (13,30,0)*(K1:K1000=360)*(F1:F1000="K"))

=SUMPRODUCT((A1:A1000=TIME(13,30,0))*(K1:K1000=36 0)*(F1:F1000="K"))

If the "times" include dates, change A1:A1000 to MOD(A1:A1000,1) to remove
the date part.

Note: I assume K1:K1000 contains __numbers__ like 360. If they are truly
strings like "360", replace 360 with "360" in the SUMPRODUCT formulas.

PS: Using a Pivot Table would be more efficient. I don't know anything
about PTs. I don't like them because they are more difficult to modify and
reference.

  #3   Report Post  
Junior Member
 
Posts: 2
Default

Thank you, YES each frame separately. No 2003 support is not needed.

Worked like a charm thank you.
Pasting my formulas here incase anyone else stumbles across this via google

=COUNTIFS(xdo!A2:A2000,"="&TIME(6,0,0),xdo!A2:A20 00,"
<"&TIME(13,30,0),xdo!K2:K2000,"360",xdo!F2:F2000," S")

=COUNTIFS(xdo!A2:A2000,"="&TIME(13,30,0),xdo!K2:K 2000,"360",xdo!F2:F2000,"S")

=COUNTIFS(xdo!A2:A2000,"<"&TIME(6,0,0),xdo!K2:K200 0,"360",xdo!F2:F2000,"S")


A little light on details. I assume you want to count each time frame
separately. If times are in A1:A1000 and you do not require Excel 2003
compatibility, try:

=COUNTIFS(A1:A1000,"<"&TIME(6,0,0),K1:K1000,360,F1 :F1000,"K")

=COUNTIFS(A1:A1000,"="&TIME(6,0,0),A1:A1000,"<"&T IME(13,30,0),K1:K1000,360,F1:F1000,"K")

=COUNTIFS(A1:A1000,"="&TIME(13,30,0),K1:K1000,360 ,F1:F1000,"K")

If you require Excel 2003, or if the "times" include dates, try:

=SUMPRODUCT((A1:A1000<TIME(6,0,0))*(K1:K1000=360)* (F1:F1000="K"))

=SUMPRODUCT((A1:A1000=TIME(6,0,0))*(A1:A1000<TIME (13,30,0)*(K1:K1000=360)*(F1:F1000="K"))

=SUMPRODUCT((A1:A1000=TIME(13,30,0))*(K1:K1000=36 0)*(F1:F1000="K"))

If the "times" include dates, change A1:A1000 to MOD(A1:A1000,1) to remove
the date part.

Note: I assume K1:K1000 contains __numbers__ like 360. If they are truly
strings like "360", replace 360 with "360" in the SUMPRODUCT formulas.

PS: Using a Pivot Table would be more efficient. I don't know anything
about PTs. I don't like them because they are more difficult to modify and
reference.[/quote]
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countifs with if and date range cvhar87 Excel Discussion (Misc queries) 2 June 17th 13 09:22 PM
Countifs to Sumproduct for 2003 - was Simple Countifs.. from Fr Steve Excel Worksheet Functions 2 January 4th 09 05:36 PM
Forumla that Looks up a range of output from one cell DKinNorthCakalacki Excel Worksheet Functions 2 August 27th 08 03:45 AM
formula to analize info in a cell Jordan Excel Worksheet Functions 3 May 24th 05 11:34 PM
IF forumla for time Leigh Ann Excel Worksheet Functions 3 May 23rd 05 06:16 PM


All times are GMT +1. The time now is 12:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"