2

I simply want to sum two cells if at least one of them is a valid number, or display blank if neither of them are. What is the best way to do this? I have read about SUMPRODUCT and tried to use ISERROR to no avail. What I finally came up with works:

=IF(OR(ISNUMBER(AG6),ISNUMBER(BB6)),(IF(ISNUMBER(AG6),AG6,0)+IF(ISNUMBER(BB6),BB6,0)),"")

but I know there must be a more efficient way.

Robin Mackenzie
  • 18,801
  • 7
  • 38
  • 56
user3925803
  • 3,115
  • 2
  • 16
  • 25

2 Answers2

1

This should work:

=IF(OR(ISNUMBER(B6),ISNUMBER(C6)),SUM(B6,C6),"")

Re the non-contiguous requirement - in the example below B6 and C6 can be any cells you want.

enter image description here

Robin Mackenzie
  • 18,801
  • 7
  • 38
  • 56
1

This also seems to work:

=IF(SUM(B6,C6)=0,"",SUM(B6,C6))

Tested with your examples.

Solar Mike
  • 7,156
  • 4
  • 17
  • 32