Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum Product if? Three columns

Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Sum Product if? Three columns

Hi!

Try this:

=SUMPRODUCT(--(B2:B5=""),A2:A5,C2:C5)

Biff

"gmunro" wrote in message
ps.com...
Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Sum Product if? Three columns

this worked for me:
=SUM(IF(B2:B5<"",A2:A5*B2:B5*C2:C5,0))

Enter as an array formula, ctrl-shift-enter



gmunro wrote:
Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 95
Default Sum Product if? Three columns

You can use sumproduct this way:
=SUMPRODUCT(A2:A5,C2:C5,--(B2:B5=""))
Change the ranges as appropiate

Hope this helps,
Miguel.

"gmunro" wrote:

Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum Product if? Three columns


Biff wrote:
Hi!

Try this:

=SUMPRODUCT(--(B2:B5=""),A2:A5,C2:C5)

Biff

This worked perfectly. You guys are the wind beneath my wings.
Incidentally, what does the -- mean"

Glen



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Sum Product if? Three columns

This worked perfectly thank you.
What does the "--" mean?
Can it be used in other functions?

Glen

Biff wrote:
Hi!

Try this:

=SUMPRODUCT(--(B2:B5=""),A2:A5,C2:C5)

Biff

"gmunro" wrote in message
ps.com...
Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Sum Product if? Three columns

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

And if you did:

Say A1 = 1234
=right(a1,1)
you'd get text back ("4")
=--right(a1,1)
would return 4 (as a number)

gmunro wrote:

This worked perfectly thank you.
What does the "--" mean?
Can it be used in other functions?

Glen

Biff wrote:
Hi!

Try this:

=SUMPRODUCT(--(B2:B5=""),A2:A5,C2:C5)

Biff

"gmunro" wrote in message
ps.com...
Hello,

I am trying to determine a sumproduct for two ranges but only for rows
where data is not present in a third range

For instance

The range a2:A5 has the following values
2
1
1
1

The range C2:C5 has the values
5
10
15
18
The range B2:B5 are empty except cell B3

I want to write a formula that will give me the sum product of A2&C2,
A4&C4, A5&C5

Cells in range B2:B5 may vary if empty or not
The A & C ranges will be of variable length and values

Any help is appreciated

Glen


--

Dave Peterson
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
Sum product of many pairs of columns KeenKiwi Excel Worksheet Functions 3 May 11th 06 12:59 PM
Adding columns w/new formulas BUT keeping subtotals Exceldawg Excel Discussion (Misc queries) 0 April 19th 06 02:58 PM
How do I wrap Excel columns in a printout? R2 Excel Discussion (Misc queries) 1 April 1st 06 09:47 AM
filter on pivot table jigio Excel Discussion (Misc queries) 4 August 28th 05 06:19 PM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM


All times are GMT +1. The time now is 04:14 PM.

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"