Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Hi,

I have 5 columns of Data (Column A through E).

I need to sum data in Col E based on satisfaction of conditions in Col
A through D.

Value in Col A should match val in p24.
Value in Col B should match val in p25.
Value in Col C should match val in p26.

(So far so good, I know I could have used sumproduct to solve, but...)

Its the column D which has been a problematic one. The value in P27
corresponds to a small table in Z1:AA10 (Basically P27 might be present
in any one of the cells Z1 through Z10). Now, whenever Cell P27 and
Cells Z1 hrough Z10 matches, then the corresponding value in Column AA
needs to be matched with the Column D values.

How to solve this? (I have 6000 rows of data and I would need to do
sumproduct summarizaton for many cells.)

regards,
HP
India

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ragdyer
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Try this:

=SUMPRODUCT((A1:A6000=P24)*(B1:B6000=P25)*(C1:C600 0=P26)*(D1:D6000=INDEX(AA1
:AA10,MATCH(P27,Z1:Z10,0)))*E1:E6000)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Hari" wrote in message
oups.com...
Hi,

I have 5 columns of Data (Column A through E).

I need to sum data in Col E based on satisfaction of conditions in Col
A through D.

Value in Col A should match val in p24.
Value in Col B should match val in p25.
Value in Col C should match val in p26.

(So far so good, I know I could have used sumproduct to solve, but...)

Its the column D which has been a problematic one. The value in P27
corresponds to a small table in Z1:AA10 (Basically P27 might be present
in any one of the cells Z1 through Z10). Now, whenever Cell P27 and
Cells Z1 hrough Z10 matches, then the corresponding value in Column AA
needs to be matched with the Column D values.

How to solve this? (I have 6000 rows of data and I would need to do
sumproduct summarizaton for many cells.)

regards,
HP
India


  #3   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup


Try

=SUMPRODUCT(--(A1:A7000=P24),--(B1:B7000=P25),--(C1:C7000=P26),--(D1:D7000=VLOOKUP(P27,Z1:AA10,2,0)),E1:E7000)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=546461

  #4   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Try:

=SUMPRODUCT(($A$1:$A$100)=P24)*($B$1:$B$100=P25)*( $C$1:$C$100=P26)*($D$1:$D$100=VLOOKUP(P27,$Z$1:$AA $10,2,FALSE))

Change ranges to suit.

HTH

"Hari" wrote:

Hi,

I have 5 columns of Data (Column A through E).

I need to sum data in Col E based on satisfaction of conditions in Col
A through D.

Value in Col A should match val in p24.
Value in Col B should match val in p25.
Value in Col C should match val in p26.

(So far so good, I know I could have used sumproduct to solve, but...)

Its the column D which has been a problematic one. The value in P27
corresponds to a small table in Z1:AA10 (Basically P27 might be present
in any one of the cells Z1 through Z10). Now, whenever Cell P27 and
Cells Z1 hrough Z10 matches, then the corresponding value in Column AA
needs to be matched with the Column D values.

How to solve this? (I have 6000 rows of data and I would need to do
sumproduct summarizaton for many cells.)

regards,
HP
India


  #5   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

.... missed the E1:E100 at he end

=SUMPRODUCT(($A$1:$A$100)=P24)*($B$1:$B$100=P25)*( $C$1:$C$100=P26)*($D$1:$D$100=VLOOKUP(P27,$Z$1:$AA $10,2,FALSE)*(E1:E100))

"Toppers" wrote:

Try:

=SUMPRODUCT(($A$1:$A$100)=P24)*($B$1:$B$100=P25)*( $C$1:$C$100=P26)*($D$1:$D$100=VLOOKUP(P27,$Z$1:$AA $10,2,FALSE))

Change ranges to suit.

HTH

"Hari" wrote:

Hi,

I have 5 columns of Data (Column A through E).

I need to sum data in Col E based on satisfaction of conditions in Col
A through D.

Value in Col A should match val in p24.
Value in Col B should match val in p25.
Value in Col C should match val in p26.

(So far so good, I know I could have used sumproduct to solve, but...)

Its the column D which has been a problematic one. The value in P27
corresponds to a small table in Z1:AA10 (Basically P27 might be present
in any one of the cells Z1 through Z10). Now, whenever Cell P27 and
Cells Z1 hrough Z10 matches, then the corresponding value in Column AA
needs to be matched with the Column D values.

How to solve this? (I have 6000 rows of data and I would need to do
sumproduct summarizaton for many cells.)

regards,
HP
India




  #6   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Hi,

Thanks to RD, Toppers and Daddylonglegs for posting solutions.

l am extremely sorry, but I forgot to add one very crucial piece of
information. (I wouldnt protest if I get any brickbats from you)

The data I have in my Z1:AA10 table has repeating values. For example
Z1 and Z6 might have same value (both of which might be equal to P27).
In that case I want the "lookup" to return both AA1 and AA6 and each of
the cells of SumProduct should be checked with both AA1 and AA6.

Why do I have data like this?

Basically, in cells P27 (and Column Z) the data I have is of PRODUCTS
at an aggregate level. On the other hand, Column AA (and Column D) the
data is of products at an Atomic level (broken down or granular level).

Just to give an example, I can have the value "Microsoft Office" in P27
while, Col D and Col AA will always have granular values like "Office
97", "Office 2000", "Office XP" and "Office 2003" etc. Now, sometimes I
might be interested in finding out number of users of Office 2000
(granular) and sometimes the consolidated product like MS office. So, I
created a lookup table (Z1:AA10) in which the Consolidated products
were listed as many times along with the corresponding granular
products and even the granular products were listed with the same
granualr value in AA.

Please assist me in finding a solution to the same.

Regards,
HP
India

  #7   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Hi,

Thanks to RD, Toppers and Daddylonglegs for posting solutions.

l am extremely sorry, but I forgot to add one very crucial piece of
information. (I wouldnt protest if I get any brickbats from you)

The data I have in my Z1:AA10 table has repeating values. For example
Z1 and Z6 might have same value (both of which might be equal to P27).
In that case I want the "lookup" to return both AA1 and AA6 and each of
the cells of SumProduct should be checked with both AA1 and AA6.

Why do I have data like this?

Basically, in cells P27 (and Column Z) the data I have is of PRODUCTS
at an aggregate level. On the other hand, Column AA (and Column D) the
data is of products at an Atomic level (broken down or granular level).

Just to give an example, I can have the value "Microsoft Office" in P27
while, Col D and Col AA will always have granular values like "Office
97", "Office 2000", "Office XP" and "Office 2003" etc. Now, sometimes I
might be interested in finding out number of users of Office 2000
(granular) and sometimes the consolidated product like MS office. So, I
created a lookup table (Z1:AA10) in which the Consolidated products
were listed as many times along with the corresponding granular
products and even the granular products were listed with the same
granualr value in AA.

Please assist me in finding a solution to the same.

Regards,
HP
India

  #8   Report Post  
Posted to microsoft.public.excel.misc
Ragdyer
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Maybe someone can come up with something better, but in the mean time, try
this *array* formula for *2* matches in AA1 to AA10:

=SUMPRODUCT((A1:A6000=P24)*(B1:B6000=P25)*(C1:C600 0=P26)*((D1:D6000=INDEX(AA
1:AA10,SMALL(IF(Z1:Z10=P27,ROW($1:$10)),1)))+(D1:D 6000=INDEX(AA1:AA10,LARGE(
IF(Z1:Z10=P27,ROW($1:$10)),1))))*E1:E6000)

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually.
You *must also* use CSE when revising the formula.


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Hari" wrote in message
oups.com...
Hi,

Thanks to RD, Toppers and Daddylonglegs for posting solutions.

l am extremely sorry, but I forgot to add one very crucial piece of
information. (I wouldnt protest if I get any brickbats from you)

The data I have in my Z1:AA10 table has repeating values. For example
Z1 and Z6 might have same value (both of which might be equal to P27).
In that case I want the "lookup" to return both AA1 and AA6 and each of
the cells of SumProduct should be checked with both AA1 and AA6.

Why do I have data like this?

Basically, in cells P27 (and Column Z) the data I have is of PRODUCTS
at an aggregate level. On the other hand, Column AA (and Column D) the
data is of products at an Atomic level (broken down or granular level).

Just to give an example, I can have the value "Microsoft Office" in P27
while, Col D and Col AA will always have granular values like "Office
97", "Office 2000", "Office XP" and "Office 2003" etc. Now, sometimes I
might be interested in finding out number of users of Office 2000
(granular) and sometimes the consolidated product like MS office. So, I
created a lookup table (Z1:AA10) in which the Consolidated products
were listed as many times along with the corresponding granular
products and even the granular products were listed with the same
granualr value in AA.

Please assist me in finding a solution to the same.

Regards,
HP
India


  #9   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Hi,

Please let me know, in case what am asking is impossible to achieve
with the standard formulas. I will have to then think of redisigning
the spreadsheet in a major way.

Regards
HP
India

  #10   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

RD,

Thanks for the response.

I put in the formula (by doing CSE) and for a particular product am
getting a value of zero. (it should be non-zero). I used the evaluate
formula feature to step in to it and notice that ROW($1:$10) always
evaluate to a value of 10. I believe that Rows($1:$10) should retrun an
array of values from 1 to 10 out of which depending on whichever of the
cases Z1:Z10=P27, the corresponding row numbers would be returned.
Please let me know in case am wrong in my supposition.

Maybe someone can come up with something better, but in the mean time, try
this *array* formula for *2* matches in AA1 to AA10


Does the above statement mean that the present CSE formula would return
correct values only if the smaller Lookup table has atmost 2 repeating
values?


Also, a doubt little unconnected to my goal here. I see that the array
part of IF condition evaluates to True and False and when the number 10
gets multiplied by 10 then False remains as false while True changes to
10. I have 2 questions he-
a) Why is False not changing to zero when multiplied by 10 but true
changes to 10 when mutliplied by 10
b) When we apply the SMALL function on a set of array values containing
FALSE and some positive numbers, why is the function not returning
False or Zero as the answer. Presently it returns the smallest positive
number.

Regards,
HP
India



  #11   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup


Try this

=SUMPRODUCT(--(A1:A7000=P24),--(B1:B7000=P25),--(C1:C7000=P26),--ISNUMBER(MATCH(D1:D7000,IF(Z1:Z10=P27,AA1:AA10,"") ,0)),E1:E7000)

confirmed with CTRL+SHIFT+ENTER


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=546461

  #12   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup


....or given that you need CSE anyway, you might as well dispense with
SUMPRODUCT altogether and just use

=SUM((A1:A7000=P24)*(B1:B7000=P25)*(C1:C7000=P26)* ISNUMBER(MATCH(D1:D7000,IF(Z1:Z10=P27,AA1:AA10,"")
,0))*E1:E7000)

confirmed with CTRL+SHIFT+ENTER


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=546461

  #13   Report Post  
Posted to microsoft.public.excel.misc
Hari
 
Posts: n/a
Default Sumproduct - Condition based on lookup of a Lookup

Daddylonglegs,

Your formula works perfectly. Thanks for your help

Regards,
HP
India

daddylonglegs wrote:
Try this

=SUMPRODUCT(--(A1:A7000=P24),--(B1:B7000=P25),--(C1:C7000=P26),--ISNUMBER(MATCH(D1:D7000,IF(Z1:Z10=P27,AA1:AA10,"") ,0)),E1:E7000)

confirmed with CTRL+SHIFT+ENTER


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=546461


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
I want to fill the cell color based upon the other cell condition sri Excel Discussion (Misc queries) 4 January 12th 06 01:47 PM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 01:01 PM
LOOKUP value based on 2 criteria Jaye Excel Worksheet Functions 1 November 22nd 04 11:08 PM
Lookup with search range start based on position of last blank lin rcmodelr Excel Worksheet Functions 0 November 14th 04 06:32 AM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


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