Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
John
 
Posts: n/a
Default Add a Dynamic Range with 2 Conditions Q

I have a Range area which is dynamic and I wish to create a formula that
will add up values within this dynamic range if two conditions exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in Col A -
location)

I only wish to add some of the products that are listed, not all. Therefore
is cell A1 on Sheet1 I want to create a formula that will do the following

Add up all quantities that are in Col E that relate to Product Number "43",
that are sold at Location - "London"

How can I do that?

Thanks


  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a formula
that will add up values within this dynamic range if two conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that will
do the following

Add up all quantities that are in Col E that relate to Product Number
"43", that are sold at Location - "London"

How can I do that?

Thanks



  #3   Report Post  
John
 
Posts: n/a
Default

Thanks Frank, little did I think one could write so much on SUMPRODUCT!

I re-hashed your formula to as follows but am receiving a #Num! error

=SUMPRODUCT(--(StoreNo=3047),--(Item="43"),Sales_Units)

The ranges above, which have the same row numbers are constructed as follows
eg. StoreNo ='Sales Mix'!$A:$A

Are Range Names allowed in SUMPRODUCT formulas?



"Frank Kabel" wrote in message
...
Hi

=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a formula
that will add up values within this dynamic range if two conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that will
do the following

Add up all quantities that are in Col E that relate to Product Number
"43", that are sold at Location - "London"

How can I do that?

Thanks





  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

You can't use references to whole column with SUMPRODUCT

I.e define your ranges as
StoreNo ='Sales Mix'!$A$2:$A$65536
or like this
StoreNo =OFFSET('Sales Mix'!$A$2,,,COUNTIF('Sales Mix'!$A:$A,"<")-1,1)
(I assume you have headers in row 1, and that data range in column A is
continuous)


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


"John" wrote in message
...
Thanks Frank, little did I think one could write so much on SUMPRODUCT!

I re-hashed your formula to as follows but am receiving a #Num! error

=SUMPRODUCT(--(StoreNo=3047),--(Item="43"),Sales_Units)

The ranges above, which have the same row numbers are constructed as

follows
eg. StoreNo ='Sales Mix'!$A:$A

Are Range Names allowed in SUMPRODUCT formulas?



"Frank Kabel" wrote in message
...
Hi


=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a formula
that will add up values within this dynamic range if two conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that will
do the following

Add up all quantities that are in Col E that relate to Product Number
"43", that are sold at Location - "London"

How can I do that?

Thanks







  #5   Report Post  
John
 
Posts: n/a
Default

Thanks Arvi, I picked the second defined Range name that you suggested and
now getting a #Value! error


"Arvi Laanemets" wrote in message
...
Hi

You can't use references to whole column with SUMPRODUCT

I.e define your ranges as
StoreNo ='Sales Mix'!$A$2:$A$65536
or like this
StoreNo =OFFSET('Sales Mix'!$A$2,,,COUNTIF('Sales Mix'!$A:$A,"<")-1,1)
(I assume you have headers in row 1, and that data range in column A is
continuous)


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


"John" wrote in message
...
Thanks Frank, little did I think one could write so much on SUMPRODUCT!

I re-hashed your formula to as follows but am receiving a #Num! error

=SUMPRODUCT(--(StoreNo=3047),--(Item="43"),Sales_Units)

The ranges above, which have the same row numbers are constructed as

follows
eg. StoreNo ='Sales Mix'!$A:$A

Are Range Names allowed in SUMPRODUCT formulas?



"Frank Kabel" wrote in message
...
Hi



=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a formula
that will add up values within this dynamic range if two conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that will
do the following

Add up all quantities that are in Col E that relate to Product

Number
"43", that are sold at Location - "London"

How can I do that?

Thanks










  #6   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Ranges aren't of same dimension!
When you used dynamic ranges (defined through OFFSET), then in COUNTIF part
use same column for all them. I.e.
StoreNo = OFFSET('Sales Mix'!$B$2,,,COUNTIF('Sales Mix'!$B:$B,"<")-1,1)
Site = OFFSET('Sales Mix'!$C$2,,,COUNTIF('Sales Mix'!$B:$B,"<")-1,1)
etc.


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)



"John" wrote in message
...
Thanks Arvi, I picked the second defined Range name that you suggested and
now getting a #Value! error


"Arvi Laanemets" wrote in message
...
Hi

You can't use references to whole column with SUMPRODUCT

I.e define your ranges as
StoreNo ='Sales Mix'!$A$2:$A$65536
or like this
StoreNo =OFFSET('Sales Mix'!$A$2,,,COUNTIF('Sales Mix'!$A:$A,"<")-1,1)
(I assume you have headers in row 1, and that data range in column A is
continuous)


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


"John" wrote in message
...
Thanks Frank, little did I think one could write so much on

SUMPRODUCT!

I re-hashed your formula to as follows but am receiving a #Num! error

=SUMPRODUCT(--(StoreNo=3047),--(Item="43"),Sales_Units)

The ranges above, which have the same row numbers are constructed as

follows
eg. StoreNo ='Sales Mix'!$A:$A

Are Range Names allowed in SUMPRODUCT formulas?



"Frank Kabel" wrote in message
...
Hi




=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a

formula
that will add up values within this dynamic range if two

conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold

in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that

will
do the following

Add up all quantities that are in Col E that relate to Product

Number
"43", that are sold at Location - "London"

How can I do that?

Thanks










  #7   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
you can't use ranges such as A:A within SUMPRODUCT. change the names to
StoreNo ='Sales Mix'!$A1:$A1000
or somethign similar

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
Thanks Frank, little did I think one could write so much on
SUMPRODUCT!

I re-hashed your formula to as follows but am receiving a #Num! error

=SUMPRODUCT(--(StoreNo=3047),--(Item="43"),Sales_Units)

The ranges above, which have the same row numbers are constructed as
follows eg. StoreNo ='Sales Mix'!$A:$A

Are Range Names allowed in SUMPRODUCT formulas?



"Frank Kabel" wrote in message
...
Hi

=SUMPRODUCT(--('data'A1:A100="London"),--('data'!C1:C100=43),'data'!E1:E100)

See:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Regards
Frank Kabel
Frankfurt, Germany

John wrote:
I have a Range area which is dynamic and I wish to create a formula
that will add up values within this dynamic range if two conditions
exist

Col A = Location
Col C = Product Number
Col E = Sales Units (of the products in Col C that have been sold in
Col A - location)

I only wish to add some of the products that are listed, not all.
Therefore is cell A1 on Sheet1 I want to create a formula that will
do the following

Add up all quantities that are in Col E that relate to Product
Number "43", that are sold at Location - "London"

How can I do that?

Thanks



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
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
Dynamic Range Problem [email protected] Excel Discussion (Misc queries) 4 January 4th 05 06:55 PM
How do I sum a range after 2 different conditions are met (2 colu. Holly B. Excel Discussion (Misc queries) 3 December 21st 04 03:47 PM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM
range names Pedro Excel Worksheet Functions 0 November 9th 04 06:26 PM


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