View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default SUM 2 cells only if there is a value in both

Hi,

You don'r need sum to subtract a number from another, try this

=IF(COUNT(B32,D32)=2,B32-D32,"")


Mike

"milt" wrote:

I want to SUM two cells in an Excel worksheet but only if there is a value in
both cells. For each month of the year I want to show total minutes (B32:43)
less minutes used (D32:43). The answer will be in (E32:43). However if I use
the simple SUM function =SUM(B32-D32) I get the total minutes in Column E if
there is nothing in column D. I've looked at SUMIF but cannot figure out how
to use it for this purpose. Thanks for your help.