Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Joker
 
Posts: n/a
Default Counting the number of cells within a certain hour.

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Counting the number of cells within a certain hour.

Try removing the AM in your formula.



Regards
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #3   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Counting the number of cells within a certain hour.

Your formula seems to be working for me so my first post is incorrect, is it
possible that your cells are not formatted as time but rather text?

HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #4   Report Post  
Posted to microsoft.public.excel.misc
Joker
 
Posts: n/a
Default Counting the number of cells within a certain hour.

The cells are formatted as time. Would it have anything to do with the fact
that I have a formula to get the times? For example in cell B48, I have the
formula,
=IF(C48="","",IF(B48="",NOW(),B48)) sp that when I type in a number in C48,
the time will automatically change in B48 and not change after that. Thank you

"pinmaster" wrote:

Your formula seems to be working for me so my first post is incorrect, is it
possible that your cells are not formatted as time but rather text?

HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #5   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default Counting the number of cells within a certain hour.

Two suggestions: instead of TIMEVALUE use TIME(3,0,0). Also, check to
see that the times in your data are plain times (i.e. times of Jan 1
1900) or full date/times formatted as time (i.e. 3:00 AM of TODAY).

If the latter is the case you have to do some tests using e.g. the
YEAR(), MONTH(), DAY() functions, to see in next columns exactly what
you have in your cells.

=SUMPRODUCT(--(TIME(HOUR(B48:B350),MINUTE(B48:B350),SECOND(B48:B 350))=TIMEVALUE("3:00
AM"),....)

might also do the trick.

Does this help?

Kostis Vezerides



  #6   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Counting the number of cells within a certain hour.

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #7   Report Post  
Posted to microsoft.public.excel.misc
Joker
 
Posts: n/a
Default Counting the number of cells within a certain hour.

That works but only if every cell in columns B48:B350 has a time in it. The
cells in column B each have a formula to automatically insert the time if
there is a number typed into the adjacent cell in column C. So if cell C49 is
blank, cell B49 is blank (just the formula is left). The formula returns
#VALUE if there is no time in one of the cells in column B. Can you think of
anyway around this and still keep the formula to auto insert the times in
column B? Thanks

"pinmaster" wrote:

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #8   Report Post  
Posted to microsoft.public.excel.misc
Joker
 
Posts: n/a
Default Counting the number of cells within a certain hour.

That works but only if every cell in from B48:B350 either has a time in it or
is completely empty. In each of these cells I have a formula to automatically
insert the current time when the adjacent cell in column C has a number typed
into it. The formula returns #VALUE if one of these cells in column B doesn't
have the time inserted and is left with just the formula. Is there any way
around this without removing the formulas in column B? Thank you.

"pinmaster" wrote:

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #9   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Counting the number of cells within a certain hour.

Try this:

In column B, ajust your formula to return a 0 instead of a blank "", you can
then use conditional formatting to hide the "0:00"'.



Regards
Jean-Guy

"Joker" wrote:

That works but only if every cell in from B48:B350 either has a time in it or
is completely empty. In each of these cells I have a formula to automatically
insert the current time when the adjacent cell in column C has a number typed
into it. The formula returns #VALUE if one of these cells in column B doesn't
have the time inserted and is left with just the formula. Is there any way
around this without removing the formulas in column B? Thank you.

"pinmaster" wrote:

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

  #10   Report Post  
Posted to microsoft.public.excel.misc
Joker
 
Posts: n/a
Default Counting the number of cells within a certain hour.

Thank you for helping me out. For some reason, excel will not recognize the 0
as 0. No matter what I set that cell value to be, it will not recognize it
when I try to conditional format it.

"pinmaster" wrote:

Try this:

In column B, ajust your formula to return a 0 instead of a blank "", you can
then use conditional formatting to hide the "0:00"'.



Regards
Jean-Guy

"Joker" wrote:

That works but only if every cell in from B48:B350 either has a time in it or
is completely empty. In each of these cells I have a formula to automatically
insert the current time when the adjacent cell in column C has a number typed
into it. The formula returns #VALUE if one of these cells in column B doesn't
have the time inserted and is left with just the formula. Is there any way
around this without removing the formulas in column B? Thank you.

"pinmaster" wrote:

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you



  #11   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Counting the number of cells within a certain hour.

I'm guessing that you put the 0 inside quotation marks in your formula,
remove the quotes or in conditional formatting use:formula is: =ISTEXT(B1)

HTH
Jean-Guy

"Joker" wrote:

Thank you for helping me out. For some reason, excel will not recognize the 0
as 0. No matter what I set that cell value to be, it will not recognize it
when I try to conditional format it.

"pinmaster" wrote:

Try this:

In column B, ajust your formula to return a 0 instead of a blank "", you can
then use conditional formatting to hide the "0:00"'.



Regards
Jean-Guy

"Joker" wrote:

That works but only if every cell in from B48:B350 either has a time in it or
is completely empty. In each of these cells I have a formula to automatically
insert the current time when the adjacent cell in column C has a number typed
into it. The formula returns #VALUE if one of these cells in column B doesn't
have the time inserted and is left with just the formula. Is there any way
around this without removing the formulas in column B? Thank you.

"pinmaster" wrote:

You're right, it doesn't seem to recognize the time value when NOW() is used,
so try this instead:

=SUMPRODUCT((TIME(HOUR(B48:B350),MINUTE(B48:B350), 0)=TIMEVALUE("3:00
AM"))*(TIME(HOUR(B48:B350),MINUTE(B48:B350),0)<=TI MEVALUE("4:00 AM")))


HTH
Jean-Guy

"Joker" wrote:

I am having trouble figuring out how to count the number of cells that fall
within a certain timeframe. In column B48:B350, I have time values. Let's say
that B48:B68 fall between 3:00 AM and 4:00 AM. What formula could I use to
find the answer of 20? The formula I tried,
=SUMPRODUCT(--(B48:B350=TIMEVALUE("3:00 AM")),--(B48:B350<TIMEVALUE("4:00
AM"))) returns 0. Thank you

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
How do I change a number in one cell to change a series of cells? lance559 Excel Discussion (Misc queries) 2 January 13th 06 08:56 PM
Counting cells with data jimbob Excel Discussion (Misc queries) 3 November 26th 05 11:00 PM
Complicated counting of cells (based on other cells contents) George Excel Worksheet Functions 3 November 7th 05 06:39 PM
Number format exactly the same, displays differently in some cells eider Excel Discussion (Misc queries) 1 July 29th 05 12:26 AM
Counting the number of cells meeting conditional formating criteria Jeff Excel Worksheet Functions 4 July 9th 05 01:18 AM


All times are GMT +1. The time now is 09:11 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"