Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default sumif returns blank if all cells blank

Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default sumif returns blank if all cells blank

Heliocracy wrote:
Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.




One way (array formula...enter with CTRL+SHIFT+ENTER):

=IF(SUM(LEN(B2:F2))=0,"",SUM(B2:F2))
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default sumif returns blank if all cells blank

Are you sure you want it in cell e2? That will give you a circular
reference...


In any case:

=IF(COUNT(B2:F2)=0,"",SUM(B2:F2))







In article ,
Heliocracy wrote:

Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default sumif returns blank if all cells blank

Alternatives:
1) USE simple =SUM(range) but give the cell a custom format that does not
display zero, such as #;-#;;

2)=IF(COUNT(B2:F2),SUM(B2:F2),"")
If any cell is non-blank then COUNT is a number greater than 0 which Excel
treats as TRUE and computes the sum, else it displays a blank

I do hope you plan to put the formula somewhere other than E2. Since B2:F2
includes E2, you will get a circular reference error with the formula in E2!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Heliocracy" wrote in message
...
Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are
not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default sumif returns blank if all cells blank

Put this in G2
=IF(AND(B2="",C2="",D2="",E2="",F2=""),"",SUM(B2:F 2))

It will give you blank only if ALL cells are blanks.

You have mentioned that you want the result in E2... that will be a circular
reference as SUM(B2:F2) includes E2 also.

If you DO want it in E2 then use
=IF(AND(B2="",C2="",D2="",F2=""),"",B2+C2+D2+F2)
"Heliocracy" wrote:

Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 144
Default sumif returns blank if all cells blank

try this formula

=IF(SUMIF(B2:F2,"<""")=0,"",SUMIF(B2:F2,"<"""))

If you place the formula in F2, you will encounter Circular Reference

HTH
--
Your feedback is very much appreciate, pls click on the Yes button below if
this posting is helpful.

Thank You

cheers, francis









"Heliocracy" wrote:

Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default sumif returns blank if all cells blank

Thanks, I did mean G2 rather than E2. The problem with your formula is that
if I enter zero in each cell B2:F2, it returns blank ("") instead of zero.
It should only return as blank when all cells in b2:f2 are blank.

"xlmate" wrote:

try this formula

=IF(SUMIF(B2:F2,"<""")=0,"",SUMIF(B2:F2,"<"""))

If you place the formula in F2, you will encounter Circular Reference

HTH
--
Your feedback is very much appreciate, pls click on the Yes button below if
this posting is helpful.

Thank You

cheers, francis









"Heliocracy" wrote:

Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default sumif returns blank if all cells blank

Try { =IF(AND(ISBLANK(B2:D2),ISBLANK(F2)),"",SUM(B2:D2,F 2)) }

I'm not sure how you were putting your example formula into E2 as it would
have created circular refernces...?

Cheers

Stu

"Heliocracy" wrote in message
...
Hi all, I have rows in which columns b-f may be blank or have numerical
values in them, and in column e of the same row I need to be able to sum
these numbers if there are any, but remain blank if ALL of columns b-f are
blank. The problem I'm having with:

{=IF(ISBLANK(B2:F2),"",SUM(B2:F2))} in cell e2

is that it returns "" if ANY of the cells in b2:f2 are blank. In other
words, I need a formula in e2 that sums b2:f2 if any of those cells are
not
blank, but returns blank if all cells in b2:f2 are blank. If all cells in
b2:f2 contain zeroes, then e2 should contain a zero, but if all cells in
b2:f2 are blank, e2 should be blank.

Thanks in advance for your help.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query returns blank cells where there should be data WillrSF Excel Discussion (Misc queries) 1 December 3rd 08 08:43 AM
sum of blank cells returns zeros Mar_W Excel Worksheet Functions 7 November 28th 06 05:53 PM
Sumif to return a blank if sum range is blank [email protected] Excel Worksheet Functions 3 May 25th 06 10:25 AM
Formula that returns Col A data in Col B, but omitting blank cells SteveC Excel Worksheet Functions 7 January 25th 06 06:48 PM
Eliminate creating list that returns blank cells Marc Todd Excel Worksheet Functions 1 January 26th 05 09:58 PM


All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"