Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default Sumproduct not returning expected results

Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 120
Default Sumproduct not returning expected results

=COUNTIF(D12:I21,"")

This works for me.

Cheers,
Jason Lepack

Dos Equis wrote:
Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Sumproduct not returning expected results

=COUNTIF(D12:I21,"<"&"")


"Dos Equis" wrote:

Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 120
Default Sumproduct not returning expected results

I appologize, you wanted the non blank cells.

=COUNTA(D12:I21)

will do the job, but if you really want to use sumproduct then:

=SUMPRODUCT(--(D12:I21<""))

Is the one for you.


Dos Equis wrote:
Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Sumproduct not returning expected results

I suspect you got your answers, note that a blank is "" in Excel, not
" " which is a space.

Regards,

Peo Sjoblom



Dos Equis wrote:
Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Sumproduct not returning expected results

Byron,

Others have given you functions to return the answer that you want.

The reason that your SUMPRODUCT() formula does not work is firstly as Peo
pointed out, <" " is not checking for a blank cell but rather checking that
the cell does not have a space in it.

Even then however your formula would not work because it would then be
checking not for filled cells but rather filled ROWS

For example if cell D12 has some data in it then --($D$12:$D$21<" ") will
indeed return an array {1;0;0;0;0;0;0;0;0;0}
However, if E12 does not have any data then --($E$12:$E$21<" ") will return
an array of {0;0;0;0;0;0;0;0;0;0}

when the first two elements are multiplied together we have 1 * 0 which of
course is 0. So if there is *ANY* cell in a row without any data in it,
then
the chain of multiplications of that element of the 6 arrays will evaluate
to zero. Only if all cells in that row have data will the multiplication of
the elements of the arrays result in 1 ie 1*1*1*1*1*1 =1

Thus all cells in a row need to have data to return anything other than
zero.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Dos Equis" wrote in message
ups.com...
Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default Sumproduct not returning expected results

Thank you all for the information and soloutions; it now works. Sandy,
Thank you for the education. I will hopefully retain that knowledge
and not make the same mistake in teh future.

Byron

Sandy Mann wrote:
Byron,

Others have given you functions to return the answer that you want.

The reason that your SUMPRODUCT() formula does not work is firstly as Peo
pointed out, <" " is not checking for a blank cell but rather checking that
the cell does not have a space in it.

Even then however your formula would not work because it would then be
checking not for filled cells but rather filled ROWS

For example if cell D12 has some data in it then --($D$12:$D$21<" ") will
indeed return an array {1;0;0;0;0;0;0;0;0;0}
However, if E12 does not have any data then --($E$12:$E$21<" ") will return
an array of {0;0;0;0;0;0;0;0;0;0}

when the first two elements are multiplied together we have 1 * 0 which of
course is 0. So if there is *ANY* cell in a row without any data in it,
then
the chain of multiplications of that element of the 6 arrays will evaluate
to zero. Only if all cells in that row have data will the multiplication of
the elements of the arrays result in 1 ie 1*1*1*1*1*1 =1

Thus all cells in a row need to have data to return anything other than
zero.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Dos Equis" wrote in message
ups.com...
Hi all,

I am using this formula to evaluate a block of cells:

=SUMPRODUCT(--($D$12:$D$21<" "),--($E$12:$E$21<" "),--($F$12:$F$21<"
"),--($G$12:$G$21<" "),--($H$12:$H$21<" "),--($I$12:$I$21<" "))

The return is 10 but should be 22. If it's set up correctly this
should be counting the number of cells which are not blank. As far as
I can tell, the only portion which is returning a count is the
$D$12:$D$21 part, all others are lost to me. Thanks for any help.

Byron


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Sumproduct not returning expected results

and not make the same mistake in teh future.

That's all any of us can hope for <g

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Dos Equis" wrote in message
ps.com...
Thank you all for the information and soloutions; it now works. Sandy,
Thank you for the education. I will hopefully retain that knowledge
and not make the same mistake in teh future.

Byron



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
Help on sumproduct returning errors Pierre Excel Worksheet Functions 2 November 16th 06 04:00 PM
Nested "if" not returning expected value Michael E W Excel Worksheet Functions 4 September 5th 05 04:50 AM
Searching and returning row number of a value MikeDH Excel Worksheet Functions 1 August 9th 05 06:06 PM
Returning expected dates London Excel Worksheet Functions 1 July 23rd 05 03:31 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


All times are GMT +1. The time now is 08:35 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"