PC Review


Reply
Thread Tools Rate Thread

dependant summing

 
 
greg
Guest
Posts: n/a
 
      23rd Jun 2008
Hello,
I would like to sum some numbers. But depending on 2 other column.
Say I have 3 named ranges.
the A column, B column and c column. = Range1, Range2, Range3

Range3 (column C) has numbers. Range 1, 2 are strings.

If I wanted to sum numbers in Range3 when Range1 = "ABC" and Range2 = "DEF"

do you use Sum (Range1="ABC....
Or do I need If statments?

thanks for any help


 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      23rd Jun 2008
=SUMPRODUCT(--(Range1="ABC"),--(Range2="DEF"),Range3)

--
__________________________________
HTH

Bob

"greg" <(E-Mail Removed)> wrote in message
news:%23caV$(E-Mail Removed)...
> Hello,
> I would like to sum some numbers. But depending on 2 other column.
> Say I have 3 named ranges.
> the A column, B column and c column. = Range1, Range2, Range3
>
> Range3 (column C) has numbers. Range 1, 2 are strings.
>
> If I wanted to sum numbers in Range3 when Range1 = "ABC" and Range2 =
> "DEF"
>
> do you use Sum (Range1="ABC....
> Or do I need If statments?
>
> thanks for any help
>



 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      23rd Jun 2008
this is an array formula, so press Ctrl+Shift+Enter after pasting it into a
cell
=SUM((A1:A10="ABC")*(B1:B10="DEF")*C1:C10)


"greg" wrote:

> Hello,
> I would like to sum some numbers. But depending on 2 other column.
> Say I have 3 named ranges.
> the A column, B column and c column. = Range1, Range2, Range3
>
> Range3 (column C) has numbers. Range 1, 2 are strings.
>
> If I wanted to sum numbers in Range3 when Range1 = "ABC" and Range2 = "DEF"
>
> do you use Sum (Range1="ABC....
> Or do I need If statments?
>
> thanks for any help
>
>
>

 
Reply With Quote
 
greg
Guest
Posts: n/a
 
      23rd Jun 2008
thanks for the help.
If I wanted to move this to vba code. I would think something like this
would work.
However, I get an object does not support this method.

Any ideas on moving to VBA?


Sub test()

Dim x
x = Excel.WorksheetFunction.SumProduct(--(Excel.ActiveWorkbook("Range1") =
"ABC"), --(Excel.ActiveWorkbook("Range2") = "DEF"),
Excel.ActiveWorkbook("Range3"))

End Sub






"Bob Phillips" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> =SUMPRODUCT(--(Range1="ABC"),--(Range2="DEF"),Range3)
>
> --
> __________________________________
> HTH
>
> Bob
>
> "greg" <(E-Mail Removed)> wrote in message
> news:%23caV$(E-Mail Removed)...
>> Hello,
>> I would like to sum some numbers. But depending on 2 other column.
>> Say I have 3 named ranges.
>> the A column, B column and c column. = Range1, Range2, Range3
>>
>> Range3 (column C) has numbers. Range 1, 2 are strings.
>>
>> If I wanted to sum numbers in Range3 when Range1 = "ABC" and Range2 =
>> "DEF"
>>
>> do you use Sum (Range1="ABC....
>> Or do I need If statments?
>>
>> thanks for any help
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
summing values in each record (summing across rows) Madison Microsoft Access 2 16th Feb 2009 11:58 PM
PivotTable and summing/not summing =?Utf-8?B?fipBbWFuZGEqfg==?= Microsoft Excel Misc 1 14th Mar 2007 07:35 PM
Dependant Combobox MBlake Microsoft Excel Programming 4 28th Apr 2005 12:01 AM
os dependant ? Jaehwang Microsoft C# .NET 4 19th Dec 2004 08:50 AM
Counting, summing, matching, summing again... =?Utf-8?B?UmV2?= Microsoft Access Forms 1 15th Dec 2004 02:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:23 PM.