Search code examples
excelexcel-formulasumisnumeric

Excel sum if isnumber for non-contiguous range


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.


Solution

  • This also seems to work:

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

    Tested with your examples.