OK, so if R is empty (actually, your sheet is showing zeroes, not blanks), then you want the formula to ignore that condition, right? And what about column M? What if that is also empty?