#1   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


Hi guys,

I've been browsing through these forums for hours, but I can't find the
answer to a problem I am having with a formula...

I have a table which looks like this:

1 Date Time Day
2 1/1/2006 21:21 Sun
3 1/1/2006 22:27 Sun
4 1/1/2006 20:13 Mon
5 1/1/2006 22:13 Mon

I am attempting to create a formula where items which were received
within a specific timeframe -AND- on a specific day will be counted.
For instance: what are the amount of items which occurred on a -Monday-
_between_ -1:00 PM -and -2:00 PM-.

The following formula is the closest I could get, but unfortunately
does not produce the desired results (please note the items in red
indicate named ranges):

=SUMPRODUCT(TEXT(CallTime,"hh:mm")"02:00")*(TEXT( CallTime,"hh:mm")<"03:00"))/(COUNTIF(Day,"Mon"))

Your help would be IMMENSELY appreciated! :)


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Demonic formula

Maybe...

=sumproduct(--(calltimetime(2,0,0)),
--(calltime<time(3,0,0)),
--(text(CallDate,"ddd")="mon")))

(all one cell)

I wouldn't use Day as a range name--it's very similar to the =day() worksheet
function.



robotfighter wrote:

Hi guys,

I've been browsing through these forums for hours, but I can't find the
answer to a problem I am having with a formula...

I have a table which looks like this:

1 Date Time Day
2 1/1/2006 21:21 Sun
3 1/1/2006 22:27 Sun
4 1/1/2006 20:13 Mon
5 1/1/2006 22:13 Mon

I am attempting to create a formula where items which were received
within a specific timeframe -AND- on a specific day will be counted.
For instance: what are the amount of items which occurred on a -Monday-
_between_ -1:00 PM -and -2:00 PM-.

The following formula is the closest I could get, but unfortunately
does not produce the desired results (please note the items in red
indicate named ranges):

=SUMPRODUCT(TEXT(CallTime,"hh:mm")"02:00")*(TEXT( CallTime,"hh:mm")<"03:00"))/(COUNTIF(Day,"Mon"))

Your help would be IMMENSELY appreciated! :)

--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Demonic formula

And for 2 to 3 pm (oopsie):

=sumproduct(--(calltimetime(14,0,0)),
--(calltime<time(15,0,0)),
--(text(CallDate,"ddd")="mon")))



Dave Peterson wrote:

Maybe...

=sumproduct(--(calltimetime(2,0,0)),
--(calltime<time(3,0,0)),
--(text(CallDate,"ddd")="mon")))

(all one cell)

I wouldn't use Day as a range name--it's very similar to the =day() worksheet
function.

robotfighter wrote:

Hi guys,

I've been browsing through these forums for hours, but I can't find the
answer to a problem I am having with a formula...

I have a table which looks like this:

1 Date Time Day
2 1/1/2006 21:21 Sun
3 1/1/2006 22:27 Sun
4 1/1/2006 20:13 Mon
5 1/1/2006 22:13 Mon

I am attempting to create a formula where items which were received
within a specific timeframe -AND- on a specific day will be counted.
For instance: what are the amount of items which occurred on a -Monday-
_between_ -1:00 PM -and -2:00 PM-.

The following formula is the closest I could get, but unfortunately
does not produce the desired results (please note the items in red
indicate named ranges):

=SUMPRODUCT(TEXT(CallTime,"hh:mm")"02:00")*(TEXT( CallTime,"hh:mm")<"03:00"))/(COUNTIF(Day,"Mon"))

Your help would be IMMENSELY appreciated! :)

--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


Unfortunately, that formula did not work for me. Using your guidelines,
the formula returned "0".


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #5   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Demonic formula

Maybe a sample implementation of Dave's suggestion
(slightly adapted) would help illustrate that
it should work fine:

http://cjoint.com/?erfsK7SzLs
robotfighter_misc.xls
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Demonic formula

If Max's workbook doesn't help, maybe you should post what your range names are
and what they hold.



robotfighter wrote:

Unfortunately, that formula did not work for me. Using your guidelines,
the formula returned "0".

--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


I applied the sample formula to my spreadsheet, but it just didn't work.
Perhaps because I am using Excel 2003, thus some formula codes are
modified in the latest version?

Here's my current formula:

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),--(TEXT(CallTime,"hh:mm")"02:00"))--(COUNTIF(WeekDay,"Mon"))

"CallTime" is a range (column) listing the various times calls have
been received - In the above example, I am attempting to retrive those
which were received between 1:00 AM and 2:00 AM (using a military time
format).

"WeekDay" represents a range (column) displaying the days of each weeek
during which each call was received. In the above example, I am looking
for all calls received on Mondays.

Therefore, In the above example, I am attempting to combine these
formulas to acquire all calls occurring on a Monday between the hours
of 1:00 AM and 2:00 AM. I would like to ultimately determine the
average amount of calls received each day of the week, broken down into
each hour of the day.

Thanks again. ;)


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #8   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


I applied the sample formula to my spreadsheet, but it just didn't work.
Perhaps because I am using Excel 2003, thus some formula codes are
modified in the latest version?

Here's my current formula:

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),--(TEXT(CallTime,"hh:mm")"02:00"))--(COUNTIF(WeekDay,"Mon"))

"CallTime" is a range (column) listing the various times calls have
been received - In the above example, I am attempting to retrive those
which were received between 1:00 AM and 2:00 AM (using a military time
format).

"WeekDay" represents a range (column) displaying the days of each weeek
during which each call was received. In the above example, I am looking
for all calls received on Mondays.

Therefore, In the above example, I am attempting to combine these
formulas to acquire all calls occurring on a Monday between the hours
of 1:00 AM and 2:00 AM. I would like to ultimately determine the
average amount of calls received each day of the week, broken down into
each hour of the day.

Thanks again. ;)


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #9   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


Also, the use of ",--" doesn't seem to work for me. Is this code
intended to be used to combine formulas? I looked it up and the
explanation didn't make sense.


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #10   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Demonic formula

First, I wouldn't use Weekday as a range name either. It's too close to the the
worksheet function =weekday().

But is that Weekday range really text containing "Mon" or is a date just
formatted to show the day of week?

If it's really text:

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),
--(TEXT(CallTime,"hh:mm")<"02:00"),
--(CallDays="Mon"))

(I changed the range name in my test workbook.)

If it's really a date formatted to show "Mon":

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),
--(TEXT(CallTime,"hh:mm")<"02:00"),
--(text(CallDays,"ddd")="Mon"))

or

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),
--(TEXT(CallTime,"hh:mm")<"02:00"),
--(weekday(CallDays)=2))

This won't matter, but I like to use the =Time() function:

=SUMPRODUCT(--(CallTimetime(1,0,0),
--(calltime<time(2,0,0),
--(CallDays="Mon"))

And watch your signs, too. You 1:00 am and 2:00 am. Not what you
described in your message.

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

robotfighter wrote:

I applied the sample formula to my spreadsheet, but it just didn't work.
Perhaps because I am using Excel 2003, thus some formula codes are
modified in the latest version?

Here's my current formula:

=SUMPRODUCT(--(TEXT(CallTime,"hh:mm")"01:00"),--(TEXT(CallTime,"hh:mm")"02:00"))--(COUNTIF(WeekDay,"Mon"))

"CallTime" is a range (column) listing the various times calls have
been received - In the above example, I am attempting to retrive those
which were received between 1:00 AM and 2:00 AM (using a military time
format).

"WeekDay" represents a range (column) displaying the days of each weeek
during which each call was received. In the above example, I am looking
for all calls received on Mondays.

Therefore, In the above example, I am attempting to combine these
formulas to acquire all calls occurring on a Monday between the hours
of 1:00 AM and 2:00 AM. I would like to ultimately determine the
average amount of calls received each day of the week, broken down into
each hour of the day.

Thanks again. ;)

--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


Thanks for taking the time to explain this in such thorough detail. I
will post back as soon as I try your formulas.


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

  #12   Report Post  
Posted to microsoft.public.excel.misc
robotfighter
 
Posts: n/a
Default Demonic formula


IT WORKED!!!!!!!!

Thanks!!!!! You just saved me tons of time! ;) :)


--
robotfighter
------------------------------------------------------------------------
robotfighter's Profile: http://www.excelforum.com/member.php...o&userid=33549
View this thread: http://www.excelforum.com/showthread...hreadid=533327

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
2 Nesting questions Starchaser Excel Worksheet Functions 7 January 20th 06 06:53 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


All times are GMT +1. The time now is 05:22 PM.

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

About Us

"It's about Microsoft Excel"