Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2007

Tip: Looking for answers? Try searching our database.

Sumproduct & Empty Cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mhoffmeier - 09 Mar 2007 15:20 GMT
I have a lengthy sumproduct that relies in part on the following test:

=SUMPRODUCT(--('Standard cost codes'!$E$2:$E$473=E124))

'Standard cost codes'!$E$2:$E$473 is a list of cost code descriptions
in text.
E124 is where the descriptions are filled out on another sheet.

When E124 contains a value in the range 'Standard cost codes'!$E$2:$E
$473, it works just fine, evaluating the appropriate cell in 'Standard
cost codes'!$E$2:$E$473 as 1, the others as 0.

If E124 is blank, however, it evaluates all the cells in 'Standard
cost codes'!$E$2:$E$473 as 1.  Rather than returning FALSE, and a
multiplier of zero, since there are no blank cells, it provides TRUE,
and a mulitplier of one for all cells, returning 472 when standing
alone as shown above.

I've worked around this with an if(isblank(E124),"",....., but I don't
understand why excel thinks a blank cell equals cells that have text
in them.

Any ideas what I've got wrong here?
Max - 09 Mar 2007 15:38 GMT
Try either:

=IF(E124="",0,SUMPRODUCT(--('Standard cost codes'!$E$2:$E$473=E124)))

or

=SUMPRODUCT(('Standard cost codes'!$E$2:$E$473=E124)*('Standard cost
codes'!$E$2:$E$473<>""))

The former would be the simpler / better
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

>I have a lengthy sumproduct that relies in part on the following test:
>
[quoted text clipped - 19 lines]
>
> Any ideas what I've got wrong here?
mhoffmeier - 09 Mar 2007 22:11 GMT
> Try either:
>
[quoted text clipped - 6 lines]
>
> The former would be the simpler / better

I realize both of those fix the problem.  But, why is it that you must
tell SUMPRODUCT not to return TRUE for the condition "" when the cells
in the range are not blank?
Max - 10 Mar 2007 04:26 GMT
> I realize both of those fix the problem.  But, why is it that you must
> tell SUMPRODUCT not to return TRUE for the condition "" when the cells
> in the range are not blank?

Blank cells are evaluated as zeros within formulas by Excel.
That's the way it's implemented.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
mhoffmeier - 12 Mar 2007 21:55 GMT
> > I realize both of those fix the problem.  But, why is it that you must
> > tell SUMPRODUCT not to return TRUE for the condition "" when the cells
[quoted text clipped - 7 lines]
> xdemechanik
> ---

Thanks for the reply.
There are no blank cells in the range.
Sumproduct is returning TRUE that all the cells in the range = BLANK
I don't understand that.
Max - 13 Mar 2007 15:52 GMT
Null strings: "" returned by formulas within the source range are treated as
being equal to blank cells in Excel's evaluation.
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> Thanks for the reply.
> There are no blank cells in the range.
> Sumproduct is returning TRUE that all the cells in the range = BLANK
> I don't understand that.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.