Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default IF statement to evaluate time data

I'm trying to use an IF statement for time based data. The data that I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm format in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to evaluate
if this value is greater than or equal to 1 and at the same time less than or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in an error.

Please help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default IF statement to evaluate time data

You might want to review this page.

http://www.cpearson.com/excel/datetime.htm#AddingTimes

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Daren" wrote:
| I'm trying to use an IF statement for time based data. The data that I'm
| evaluating is in the 0:05 time format, which is the same as [h]:mm format
in
| custom formatting under cell formats.
|
| Here's the scenario. The data in cell k1 is 0:05. I'm trying to evaluate
| if this value is greater than or equal to 1 and at the same time less than
or
| equal to 5. My current logic statement is set as:
|
| =IF(1<=k1<=5, "1-5",false). This returns false.
|
| I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in an
error.
|
| Please help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default IF statement to evaluate time data

=IF(AND(1<=K1,K1<=5),"1-5")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
I'm trying to use an IF statement for time based data. The data that I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm format

in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to evaluate
if this value is greater than or equal to 1 and at the same time less than

or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in an

error.

Please help.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default IF statement to evaluate time data

Tried that but it returns it as false. This may have something to do with
the 0:05
formatting in the cell that I want to evaluate. That is, the 0:05 in k1 is
returned based on an IF statement itself. Might this affect the result of
getting false? Do you have other suggestions?

Thanks.

"Bob Phillips" wrote:

=IF(AND(1<=K1,K1<=5),"1-5")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
I'm trying to use an IF statement for time based data. The data that I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm format

in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to evaluate
if this value is greater than or equal to 1 and at the same time less than

or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in an

error.

Please help.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default IF statement to evaluate time data

The serialized value of 0:05:00 = 0.00347222222222222

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Daren" wrote:
| Tried that but it returns it as false. This may have something to do with
| the 0:05
| formatting in the cell that I want to evaluate. That is, the 0:05 in k1 is
| returned based on an IF statement itself. Might this affect the result of
| getting false? Do you have other suggestions?
|
| Thanks.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default IF statement to evaluate time data

Maybe you want

=IF(AND(TIME(1,0,0)<=K1,K1<=TIME(5,0,0)),"1-5")


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
Tried that but it returns it as false. This may have something to do with
the 0:05
formatting in the cell that I want to evaluate. That is, the 0:05 in k1 is
returned based on an IF statement itself. Might this affect the result of
getting false? Do you have other suggestions?

Thanks.

"Bob Phillips" wrote:

=IF(AND(1<=K1,K1<=5),"1-5")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
I'm trying to use an IF statement for time based data. The data that

I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm

format
in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to

evaluate
if this value is greater than or equal to 1 and at the same time less

than
or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in

an
error.

Please help.






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default IF statement to evaluate time data

Tried this one and it's still returning a false. Thanks though. If you have
some other suggestions, please let me know.

"Bob Phillips" wrote:

Maybe you want

=IF(AND(TIME(1,0,0)<=K1,K1<=TIME(5,0,0)),"1-5")


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
Tried that but it returns it as false. This may have something to do with
the 0:05
formatting in the cell that I want to evaluate. That is, the 0:05 in k1 is
returned based on an IF statement itself. Might this affect the result of
getting false? Do you have other suggestions?

Thanks.

"Bob Phillips" wrote:

=IF(AND(1<=K1,K1<=5),"1-5")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
I'm trying to use an IF statement for time based data. The data that

I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm

format
in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to

evaluate
if this value is greater than or equal to 1 and at the same time less

than
or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in

an
error.

Please help.






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default IF statement to evaluate time data

What is in K1?

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
Tried this one and it's still returning a false. Thanks though. If you

have
some other suggestions, please let me know.

"Bob Phillips" wrote:

Maybe you want

=IF(AND(TIME(1,0,0)<=K1,K1<=TIME(5,0,0)),"1-5")


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
Tried that but it returns it as false. This may have something to do

with
the 0:05
formatting in the cell that I want to evaluate. That is, the 0:05 in

k1 is
returned based on an IF statement itself. Might this affect the

result of
getting false? Do you have other suggestions?

Thanks.

"Bob Phillips" wrote:

=IF(AND(1<=K1,K1<=5),"1-5")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Daren" wrote in message
...
I'm trying to use an IF statement for time based data. The data

that
I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm

format
in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to

evaluate
if this value is greater than or equal to 1 and at the same time

less
than
or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results

in
an
error.

Please help.








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default IF statement to evaluate time data

Thanks. Tried that as k1<=0.00347 but it still returned false

"Dave Patrick" wrote:

The serialized value of 0:05:00 = 0.00347222222222222

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Daren" wrote:
| Tried that but it returns it as false. This may have something to do with
| the 0:05
| formatting in the cell that I want to evaluate. That is, the 0:05 in k1 is
| returned based on an IF statement itself. Might this affect the result of
| getting false? Do you have other suggestions?
|
| Thanks.



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default IF statement to evaluate time data

Didn't you mean?

=IF(AND(TIME(0,1,0)<=K1,K1<=TIME(0,5,0)),"1-5")

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Bob Phillips" wrote:
| What is in K1?
|
| --
|
| HTH
|
| Bob Phillips
|
| (replace xxxx in the email address with gmail if mailing direct)




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default IF statement to evaluate time data

I've posted a response in .functions which generates all your ranges.

Pete

Daren wrote:
I'm trying to use an IF statement for time based data. The data that I'm
evaluating is in the 0:05 time format, which is the same as [h]:mm format in
custom formatting under cell formats.

Here's the scenario. The data in cell k1 is 0:05. I'm trying to evaluate
if this value is greater than or equal to 1 and at the same time less than or
equal to 5. My current logic statement is set as:

=IF(1<=k1<=5, "1-5",false). This returns false.

I've also tried =IF(0:01<=k1<=0:05,"1-5",false), but that results in an error.

Please help.


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
Using IF statement to evaluate Greater or Less than Conditions Shams Excel Discussion (Misc queries) 2 April 3rd 08 04:49 PM
Multiple Conditions for IF statement to evaluate Bees*Stars Excel Worksheet Functions 1 March 13th 07 10:20 PM
IF statement for time based data Daren Excel Worksheet Functions 13 October 22nd 06 04:19 AM
Evaluate time spent on macro running Morris[_2_] Excel Programming 1 September 20th 06 11:35 AM
Select Case Statement does not evaluate Jeff[_44_] Excel Programming 11 April 6th 05 09:32 PM


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