Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Micos3
 
Posts: n/a
Default Don't count 0:00h as 24h

Hi, i have a table in which counts the hours that are in a period that i
define, i had a precious help, that have gived me this formula:

=MAX(MIN(MOD(B1,1),$N$1)-MAX(MOD(A1,1),$M$1),0)
A B C D M N
1 18:00 21:00 Ponta 1:00 20:00 0:00
2 21:00 0:00 Cheias 3:00

And it works, except if i put 0:00 in N column, final term. The problem is
that in column D2 it doesn't appear 3:00 it appears 0:00, because he can't
recognize 0:00 as 24:00, ando so returns 0:00. The format is h:mm.

Anyone knows how to solve this problem?
tks
  #2   Report Post  
George Nicholson
 
Posts: n/a
Default

Change the Cell Formating to [h]:mm, then hours won't "roll over"

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Micos3" wrote in message
...
Hi, i have a table in which counts the hours that are in a period that i
define, i had a precious help, that have gived me this formula:

=MAX(MIN(MOD(B1,1),$N$1)-MAX(MOD(A1,1),$M$1),0)
A B C D M N
1 18:00 21:00 Ponta 1:00 20:00 0:00
2 21:00 0:00 Cheias 3:00

And it works, except if i put 0:00 in N column, final term. The problem is
that in column D2 it doesn't appear 3:00 it appears 0:00, because he can't
recognize 0:00 as 24:00, ando so returns 0:00. The format is h:mm.

Anyone knows how to solve this problem?
tks



  #3   Report Post  
Micos3
 
Posts: n/a
Default

It is formatted as h:mm.

The problem is in second row.
It works just fine if i put 23:59 in where is 0:00, it counts 2:59.
But as it is right now it counts 0:00, because he reads like in formula
"minimum of 0:00 and 0:00" so it is 0:00, but it should be 24:00, and the
maximum of 21:00 or 20:00, taht he reads 21.
Now the min=0 tha max=21; so it gives 0-21=-21
once the formula is max of(-21;0) it gives back 0:00:00

One way i'm triyng to solve the problem is to do an "if" in the cell that
makes the reading of 0:00 and changes it to 24 only in formula, something
like this:
=MAX(MIN(MOD(if(B1=0:00:00;24:00:00;b1);1);IF($N$1 =0:00:00;24:00:00;$N$23))-MAX(MOD(A1;1);$M$1);0)

Understand what i'm triyng to do?
It could be used an hide cell in which it could read the diference if the
cell as 0:00 in final term of the period.


"George Nicholson" escreveu:

Change the Cell Formating to [h]:mm, then hours won't "roll over"

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Micos3" wrote in message
...
Hi, i have a table in which counts the hours that are in a period that i
define, i had a precious help, that have gived me this formula:

=MAX(MIN(MOD(B1,1),$N$1)-MAX(MOD(A1,1),$M$1),0)
A B C D M N
1 18:00 21:00 Ponta 1:00 20:00 0:00
2 21:00 0:00 Cheias 3:00

And it works, except if i put 0:00 in N column, final term. The problem is
that in column D2 it doesn't appear 3:00 it appears 0:00, because he can't
recognize 0:00 as 24:00, ando so returns 0:00. The format is h:mm.

Anyone knows how to solve this problem?
tks




  #4   Report Post  
George Nicholson
 
Posts: n/a
Default

If it is formated as h:mm it will never read 24:00. 23:59 is the highest it
will go before it "rolls over" to 1 day, 0 hours, 0 minutes, i.e., 0:00.

Format of [h]:mm will display 24:00

--
George Nicholson

Remove 'Junk' from return address.


"Micos3" wrote in message
...
It is formatted as h:mm.

The problem is in second row.
It works just fine if i put 23:59 in where is 0:00, it counts 2:59.
But as it is right now it counts 0:00, because he reads like in formula
"minimum of 0:00 and 0:00" so it is 0:00, but it should be 24:00, and the
maximum of 21:00 or 20:00, taht he reads 21.
Now the min=0 tha max=21; so it gives 0-21=-21
once the formula is max of(-21;0) it gives back 0:00:00

One way i'm triyng to solve the problem is to do an "if" in the cell that
makes the reading of 0:00 and changes it to 24 only in formula, something
like this:
=MAX(MIN(MOD(if(B1=0:00:00;24:00:00;b1);1);IF($N$1 =0:00:00;24:00:00;$N$23))-MAX(MOD(A1;1);$M$1);0)

Understand what i'm triyng to do?
It could be used an hide cell in which it could read the diference if the
cell as 0:00 in final term of the period.


"George Nicholson" escreveu:

Change the Cell Formating to [h]:mm, then hours won't "roll over"

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Micos3" wrote in message
...
Hi, i have a table in which counts the hours that are in a period that
i
define, i had a precious help, that have gived me this formula:

=MAX(MIN(MOD(B1,1),$N$1)-MAX(MOD(A1,1),$M$1),0)
A B C D M
N
1 18:00 21:00 Ponta 1:00 20:00 0:00
2 21:00 0:00 Cheias 3:00

And it works, except if i put 0:00 in N column, final term. The problem
is
that in column D2 it doesn't appear 3:00 it appears 0:00, because he
can't
recognize 0:00 as 24:00, ando so returns 0:00. The format is h:mm.

Anyone knows how to solve this problem?
tks






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
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 0 May 15th 05 08:14 PM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 01:37 AM
Count number to reach a cumulative value Bruce Excel Worksheet Functions 5 January 25th 05 05:14 PM


All times are GMT +1. The time now is 04:21 PM.

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"