How to combine values from two fields with conditional logic