View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Sumif to return a blank if sum range is blank

Maybe this:

Note: formulas cannot make cells *blank*, but they can make cells *appear*
blank.

For a data range of A1:B10

If Col_A cells contain 2 and the corresponding Col_B values contain at least
one number, this formula returns the total. Otherwise it returns "".
C1: =IF(SUMPRODUCT((A1:A10=2)*ISNUMBER(B1:B10)),SUMIF( A1:A10,2,B1:B10),"")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


" wrote:

Seemingly simple but actually difficult?

I want a sumif formula that sums the target range if any of the cells
matched are not blank, if all of the cells matched are blank then it
should return a blank (and not a 0). If the sum range does have any
values (including 0!) then it should return the sum.

Example

Col to Match Col to Sum
A B
1
2 23
1
1
3 0
3

So in column C I need my sumif formula. It should return BLANK for all
rows with 1 in column A, 23 for row 2 and 0 for all rows with a 3 in
column A.


Any ideas?