How to compare two fields in a preprocess_field()
hook_preprocess_field() is invoked while rendering a single field, but (basing on the documentation for field.tpl.php) $variables['element']['#object'] is the entity object to which the field is attached. Through that, you can get the value of the other field you are looking for.