Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default SUMPRODUCT with trying to create array of non-blanks

Hi...

I have two columns of information, and I want to add all elements in one
where the corresponding elements are non-blanks on the other column.

I know I can generate a new column that has a TRUE or 1 if a value in
another column is nonblank, and then simply use that to multiply, and then do
the sum. But I'm trying to do it in one go, and having problems, mainly
arround getting an array that represents the nonblanks of one column.

Psuedocode would be something like:
SUMPRODUCT(A3:A8,ISBLANK(B3:B8))

But that second argument is the problem. I have tried using IF statements
to see if that generated an element by element comparison but no success.

I'm sure this is easy, but havn't been able to find something.

Thanks ahead of time for your help,
Dan

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default SUMPRODUCT with trying to create array of non-blanks

Dan,

You don't need a helper column you can simply do this

=SUMPRODUCT((A3:A8<"")*(B3:B8))

Which sums B3 - B8 where there are data in the corresponding Column A

Mike

"dan" wrote:

Hi...

I have two columns of information, and I want to add all elements in one
where the corresponding elements are non-blanks on the other column.

I know I can generate a new column that has a TRUE or 1 if a value in
another column is nonblank, and then simply use that to multiply, and then do
the sum. But I'm trying to do it in one go, and having problems, mainly
arround getting an array that represents the nonblanks of one column.

Psuedocode would be something like:
SUMPRODUCT(A3:A8,ISBLANK(B3:B8))

But that second argument is the problem. I have tried using IF statements
to see if that generated an element by element comparison but no success.

I'm sure this is easy, but havn't been able to find something.

Thanks ahead of time for your help,
Dan

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dan dan is offline
external usenet poster
 
Posts: 866
Default SUMPRODUCT with trying to create array of non-blanks

Thanks Mike,

That is perfect. Works like a charm. Sorry for the simple question, and
appreciate the super quick response!

-Dan


"Mike H" wrote:

Dan,

You don't need a helper column you can simply do this

=SUMPRODUCT((A3:A8<"")*(B3:B8))

Which sums B3 - B8 where there are data in the corresponding Column A

Mike

"dan" wrote:

Hi...

I have two columns of information, and I want to add all elements in one
where the corresponding elements are non-blanks on the other column.

I know I can generate a new column that has a TRUE or 1 if a value in
another column is nonblank, and then simply use that to multiply, and then do
the sum. But I'm trying to do it in one go, and having problems, mainly
arround getting an array that represents the nonblanks of one column.

Psuedocode would be something like:
SUMPRODUCT(A3:A8,ISBLANK(B3:B8))

But that second argument is the problem. I have tried using IF statements
to see if that generated an element by element comparison but no success.

I'm sure this is easy, but havn't been able to find something.

Thanks ahead of time for your help,
Dan

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default SUMPRODUCT with trying to create array of non-blanks

Glad I could help

"dan" wrote:

Thanks Mike,

That is perfect. Works like a charm. Sorry for the simple question, and
appreciate the super quick response!

-Dan


"Mike H" wrote:

Dan,

You don't need a helper column you can simply do this

=SUMPRODUCT((A3:A8<"")*(B3:B8))

Which sums B3 - B8 where there are data in the corresponding Column A

Mike

"dan" wrote:

Hi...

I have two columns of information, and I want to add all elements in one
where the corresponding elements are non-blanks on the other column.

I know I can generate a new column that has a TRUE or 1 if a value in
another column is nonblank, and then simply use that to multiply, and then do
the sum. But I'm trying to do it in one go, and having problems, mainly
arround getting an array that represents the nonblanks of one column.

Psuedocode would be something like:
SUMPRODUCT(A3:A8,ISBLANK(B3:B8))

But that second argument is the problem. I have tried using IF statements
to see if that generated an element by element comparison but no success.

I'm sure this is easy, but havn't been able to find something.

Thanks ahead of time for your help,
Dan

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default SUMPRODUCT with trying to create array of non-blanks

Hi,

You can also use this

SUMPRODUCT((NOT(ISBLANK(B3:B8)))*(B3:B8))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"dan" wrote in message
...
Hi...

I have two columns of information, and I want to add all elements in one
where the corresponding elements are non-blanks on the other column.

I know I can generate a new column that has a TRUE or 1 if a value in
another column is nonblank, and then simply use that to multiply, and then
do
the sum. But I'm trying to do it in one go, and having problems, mainly
arround getting an array that represents the nonblanks of one column.

Psuedocode would be something like:
SUMPRODUCT(B3:B8,ISBLANK(B3:B8))

But that second argument is the problem. I have tried using IF statements
to see if that generated an element by element comparison but no success.

I'm sure this is easy, but havn't been able to find something.

Thanks ahead of time for your help,
Dan

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
Sumproduct with blanks and the numeric 0 taurus99 Excel Discussion (Misc queries) 3 September 24th 08 02:44 AM
Counting non blanks with SUMPRODUCT? Mifty Excel Discussion (Misc queries) 4 February 7th 08 01:00 PM
Sumproduct copying blanks or how to insert zero into blanks asg2307 Excel Worksheet Functions 4 April 4th 07 07:26 PM
Conditional Average Array with Dates, <blanks, 0 tangomj Excel Worksheet Functions 7 July 14th 06 06:26 PM
Sumproduct - Blanks wal50 Excel Worksheet Functions 7 April 28th 06 04:49 PM


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