Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
David
 
Posts: n/a
Default how to write 'not equals blank' criteria in SUMIF

Hi, and TIA for your time.
I've tried SUMIF(A1:C1,"<"""",A2:C2) where the 2nd argument needs to be
'not equal to blank. Please advise on the correct syntax.
Thanks
--
David
  #2   Report Post  
Nick
 
Posts: n/a
Default

Enter the criteria <"" in a cell then reference the cell instead of typing
the criteria directly in the formula

B1 contains <""

=SUMIF(A1:C1,B1,A2:C2)

Nick


"David" wrote in message
...
Hi, and TIA for your time.
I've tried SUMIF(A1:C1,"<"""",A2:C2) where the 2nd argument needs to be
'not equal to blank. Please advise on the correct syntax.
Thanks
--
David



  #3   Report Post  
bj
 
Posts: n/a
Default

try
=SUMIF(A1:C1,"<"&"",A2:C2)
"David" wrote:

Hi, and TIA for your time.
I've tried SUMIF(A1:C1,"<"""",A2:C2) where the 2nd argument needs to be
'not equal to blank. Please advise on the correct syntax.
Thanks
--
David

  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Nick wrote...
Enter the criteria <"" in a cell then reference the cell instead of

typing
the criteria directly in the formula

B1 contains <""

=SUMIF(A1:C1,B1,A2:C2)


First off, B1 would be contained in A1:C1, so bad choice of cell to
contain the criteria. Then, that criteria doesn't do what you think it
does - it'll exclude cells evaluating to the string containing two
double quotes. To exclude blank cells, use

=SUMIF(A1:C1,"<",A2:C2)

Note that this won't exclude columns in which the row 1 cell evaluates
to a zero length string, "". To exclude those as well, easier to use

=SUMPRODUCT(--(A1:C1<""),A2:C2)

  #5   Report Post  
David
 
Posts: n/a
Default

Thanks again Harlan
--
David


  #6   Report Post  
Nick
 
Posts: n/a
Default

OK good spot, the formula should have read =SUMIF(A1:A3,C1,B1:B3)
with the entry <"" in cell C1.

You are then summing values in B1:B3 where values in A1:A3 are not blank ie
they contain something even if it is a space.

That works.

Nick



"Harlan Grove" wrote in message
oups.com...
Nick wrote...
Enter the criteria <"" in a cell then reference the cell instead of

typing
the criteria directly in the formula

B1 contains <""

=SUMIF(A1:C1,B1,A2:C2)


First off, B1 would be contained in A1:C1, so bad choice of cell to
contain the criteria. Then, that criteria doesn't do what you think it
does - it'll exclude cells evaluating to the string containing two
double quotes. To exclude blank cells, use

=SUMIF(A1:C1,"<",A2:C2)

Note that this won't exclude columns in which the row 1 cell evaluates
to a zero length string, "". To exclude those as well, easier to use

=SUMPRODUCT(--(A1:C1<""),A2:C2)



  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Nick" wrote...
OK good spot, the formula should have read =SUMIF(A1:A3,C1,B1:B3)
with the entry <"" in cell C1.

You are then summing values in B1:B3 where values in A1:A3 are not blank ie
they contain something even if it is a space.

That works.

....

That does not work, and you seem not to have tested it last time or this
time.

In a new worksheet, leave A1 blank, enter ="" in A2 and ="""""" in A3, and
enter {1;10;100} in B1:B3. Enter <"" in C1 and your formula in D1. What
does it return? On my system it returns 11, the sum of B1 and B2, which
correspond to the cells A1 and A2, which appear blank/empty.

Change C1 to < and D1 returns 110, which reflects the nasty truth that
SUMIF doesn't handle zero length strings as most people expect it should.


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
How do I use the sumif if I have multiple criteria (i.e. greater . Kellyatisl Excel Worksheet Functions 3 June 4th 06 06:33 AM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
count non blank cells which meet criteria in another column cmarsh5035 Excel Worksheet Functions 2 February 16th 05 04:32 PM
"criteria" in a sumif refering to the value in another cell mark Excel Discussion (Misc queries) 1 January 31st 05 07:39 PM
Can I use a cell reference in the criteria for the sumif function. Number Cruncher Excel Worksheet Functions 2 November 4th 04 07:52 PM


All times are GMT +1. The time now is 03:45 PM.

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

About Us

"It's about Microsoft Excel"