• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

function that searches current time in to an interval and returns.

Antonio557580

New Member
hello guys

I need a function that searches current time in to an interval and returns what ever line i want. if true, if false.
i made this but does not seem to work :/

in B3 we have =NOW() formated as h,mm
=IF(AND(B3>TIME(8,0,0),B3<TIME(20,0,0)),"tura zi","tura noapte")

only this one works:
on B4 we have a two digits number formated as general ... :/
=IF(AND(B4>8,B4<20),"tura zi","tura noapte")

thank you!
 
Hi ,

The problem is that the NOW function returns a value which has a date component. To convert this to a time component alone , you need to do the following :

=B3 - INT(B3)

or

=MOD(B3,1)

Use this in your original formula , as in :

=IF(AND(MOD(B3,1)>TIME(8,0,0),MOD(B3,1)<TIME(20,0,0)),"tura zi","tura noapte")

Narayan
 
Back
Top