Thread: 2 codes in 1
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
puiuluipui puiuluipui is offline
external usenet poster
 
Posts: 468
Default 2 codes in 1

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"),""))

The problem is that this code it's working only for "COS" situation. For
"ACE" situation i have to change the referance "K5" and "L5" manually. But
it's time consuming. I need one code for both situations.

i have two groups
("COS" and "COS 1") (referance "K5" and "J5") with "time" (<11:00:00) and
(11:00:00)
and
("ACE", "VAN" and "ACH") (referance "L5") and no "time"

Can this be done?

Thanks in advance!