Thread: If
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
puiuluipui puiuluipui is offline
external usenet poster
 
Posts: 468
Default If

Hi, i need the code a little more complex. My question was not correct. Sorry
for that. I will try to explain better. This is the "history" of what i need.

I first had this code:

=IF(F5="COS",IF(J5<B5,"Late ","Early
")&TEXT(ABS(J5-B5),"hh:mm:ss"),IF(F5="ACE",IF(L5<B5,"Late ","Early
")&TEXT(ABS(L5-B5),"hh:mm:ss"),""))

After that, i need it like this:...

Only "COS" to display the result by time
If it's less than 11:00:00 the reference to be "J5"
If it's bigger than 11:00:00 the reference to be "K5"



And i had this code:

=IF(AND(F5="COSMETICE 1",B5 --"11:00:00"),IF(K5<B5,"Late
","Early")&TEXT(ABS(K5-B5),"hh:mm:ss"),IF(OR(F5="ACE",AND(F5="COSMETICE
1",B5<=--"11:00:00")),IF(J5<B5,"Late ","Early
")&TEXT(ABS(J5-B5),"hh:mm:ss"),""))

Finally, i need :...

"cos" and "cos 1" to have reference from "J5" and "K5" and to display result
by time.
and
"ace", "van", and "ach" to have reference from "L5". (i don't want the
code to display time)


I hope i wrote everything corectly. And sorry for this long story but i
wanted to explain better because this code will help me allot.

Thanks for your first code and i hope you can help me with this one too.

Thanks in advance.





Bob Phillips" wrote:

=IF(AND(OR(F5="COS",F5="ACE"),B5--"11:00:00"),IF(K5<B5,"Late","Early")&TEXT(ABS( K5-B5),"hh:mm:ss"),IF(OR(F5="ACE",AND(F5="COS",B5<=--"11:00:00")),IF(J5<B5,"Late","Early")&TEXT(ABS (J5-B5),"hh:mm:ss"),""))


--
__________________________________
HTH

Bob

"puiuluipui" wrote in message
...
Hi, i have this code:


=IF(AND(F5="COS",B5--"11:00:00"),IF(K5<B5,"Late","Early")&TEXT(ABS( K5-B5),"hh:mm:ss"),IF(OR(F5="ACE",AND(F5="COS",B5<=--"11:00:00")),IF(J5<B5,"Late","Early")&TEXT(ABS (J5-B5),"hh:mm:ss"),""))

Can i make the code something like :

=IF(AND(F5="COS",B5--"11:00:00"),IF(K5<B5,"Late","Early")&TEXT(ABS( K5-B5),"hh:mm:ss"),IF(OR(F5="ACE",AND(F5="COS",B5<=--"11:00:00")),IF(J5<B5,"Late","Early")&TEXT(ABS (J5-B5),"hh:mm:ss"),""))
and
IF(AND(F5="ACE",B5--"11:00:00"),IF(K5<B5,"Late","Early")&TEXT(ABS( K5-B5),"hh:mm:ss"),IF(OR(F5="COS",AND(F5="ACE",B5<=--"11:00:00")),IF(J5<B5,"Late","Early")&TEXT(ABS (J5-B5),"hh:mm:ss"),""))

Thanks.