ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF statement to evaluate time data (https://www.excelbanter.com/excel-programming/375655-if-statement-evaluate-time-data.html)

Daren

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.

Dave Patrick

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.



Bob Phillips

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.




Daren

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.





Dave Patrick

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.



Bob Phillips

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.







Daren

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.







Bob Phillips

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.









Daren

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.




Dave Patrick

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)



Pete_UK

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.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com