Link to home
Start Free TrialLog in
Avatar of agwalsh
agwalsh

asked on

time formatting in formula

hi Folks
I've created this formula...the idea being that if the status column shows less than 5 minutes and H3 is not the same as h2, it should show up as transient
=IF(AND(H3<>H2,TEXT([@Status],"[mm]:ss")<5),"transient","resident"). However when I copy down the formula, everything is showing as resident and I think it's to do with the 5 in my formula. I've formatted the status column as time.
How can I show my 5 as five minutes or is there something else?
Thanks as always..
SOLUTION
Avatar of Sreeram
Sreeram
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of agwalsh
agwalsh

ASKER

@Kujumbio - tried your approach and I can see it's nearly there..Couple of questions though..

Your formula was:
=IF(AND(H3<>H2,ROUND(C9*1440,0))<5),"transient","resident")
simply because c9 wasn't a relevant cell

I adjusted it to:

=IF(AND(H4<>H3,ROUND([@Status]*1440,0)<5),"transient","resident").
Unfortunately this is still giving me "resident status"
I also formatted Status as "[HH]:mm" but I'm still getting all Residents.

Would the following have any impact? I've used =TEXT(A3-A2,"[h]:mm:ss") to extract the Time Elapsed and =TEXT([@[Time Elapsed]],"[HH]:mm") to show Status..

I'm attaching a sample file to illustrate. Thanks for all your help. Much appreciated.
I've tried all your approaches as you can see in the file but reckon I'm missing something in my time formatting..
EE--If-on-time.xlsx
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of agwalsh

ASKER

Have awarded you all points because you all helped to the solution - which eventually I did as:
=IF(AND(H5=H4,[@[Time Elapsed]]>TIME(0,5,0)),"resident","transient")
I gave BarryHoudini best solution because his answer was the closest to what I eventually got working for me. But THANK YOU as always to all of you :-)