#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 55
Default Sumproduct

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Sumproduct

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 55
Default Sumproduct

Thanks Stefi, but I'm trying to find a way to do it without changing Table 1.
I already wrote macro that adds "vlookup" column to Table 1, but if it is
possible to get a result without changing Table 1 (using formula) my life
would be much easier. (Actually I wrote function that works fine but it is
quiet slow so I'm trying to find a way to do it using excel functions.)

Thanks anyway,
Oscar.

"Stefi" wrote:

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Sumproduct

If Table 1 is in A1:B4 and Table 2 is in D1:E3 (and is sorted per your
example), try:

=SUMPRODUCT(--(LOOKUP(A1:A4,D1:D3,E1:E3)=H1),B1:B4)


"Oscar" wrote:

Thanks Stefi, but I'm trying to find a way to do it without changing Table 1.
I already wrote macro that adds "vlookup" column to Table 1, but if it is
possible to get a result without changing Table 1 (using formula) my life
would be much easier. (Actually I wrote function that works fine but it is
quiet slow so I'm trying to find a way to do it using excel functions.)

Thanks anyway,
Oscar.

"Stefi" wrote:

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Sumproduct

Although if I_3 did not exist in table 2, lookup would match I_3 in table 1
to I_2 in table 2 and return an erronous result. Given the same assumptions
as to the location of Table 1 and Table 2 and say H1 = G_1, I would change my
suggestion to:

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:A4&H1,D1:D3&E1:E3,0))),B1:B4)


"JMB" wrote:

If Table 1 is in A1:B4 and Table 2 is in D1:E3 (and is sorted per your
example), try:

=SUMPRODUCT(--(LOOKUP(A1:A4,D1:D3,E1:E3)=H1),B1:B4)


"Oscar" wrote:

Thanks Stefi, but I'm trying to find a way to do it without changing Table 1.
I already wrote macro that adds "vlookup" column to Table 1, but if it is
possible to get a result without changing Table 1 (using formula) my life
would be much easier. (Actually I wrote function that works fine but it is
quiet slow so I'm trying to find a way to do it using excel functions.)

Thanks anyway,
Oscar.

"Stefi" wrote:

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 55
Default Sumproduct

Exactly what I was looking for!

Thanks a lot,
Oscar.

"JMB" wrote:

Although if I_3 did not exist in table 2, lookup would match I_3 in table 1
to I_2 in table 2 and return an erronous result. Given the same assumptions
as to the location of Table 1 and Table 2 and say H1 = G_1, I would change my
suggestion to:

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:A4&H1,D1:D3&E1:E3,0))),B1:B4)


"JMB" wrote:

If Table 1 is in A1:B4 and Table 2 is in D1:E3 (and is sorted per your
example), try:

=SUMPRODUCT(--(LOOKUP(A1:A4,D1:D3,E1:E3)=H1),B1:B4)


"Oscar" wrote:

Thanks Stefi, but I'm trying to find a way to do it without changing Table 1.
I already wrote macro that adds "vlookup" column to Table 1, but if it is
possible to get a result without changing Table 1 (using formula) my life
would be much easier. (Actually I wrote function that works fine but it is
quiet slow so I'm trying to find a way to do it using excel functions.)

Thanks anyway,
Oscar.

"Stefi" wrote:

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Sumproduct

you're welcome. thanks for posting back.

"Oscar" wrote:

Exactly what I was looking for!

Thanks a lot,
Oscar.

"JMB" wrote:

Although if I_3 did not exist in table 2, lookup would match I_3 in table 1
to I_2 in table 2 and return an erronous result. Given the same assumptions
as to the location of Table 1 and Table 2 and say H1 = G_1, I would change my
suggestion to:

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:A4&H1,D1:D3&E1:E3,0))),B1:B4)


"JMB" wrote:

If Table 1 is in A1:B4 and Table 2 is in D1:E3 (and is sorted per your
example), try:

=SUMPRODUCT(--(LOOKUP(A1:A4,D1:D3,E1:E3)=H1),B1:B4)


"Oscar" wrote:

Thanks Stefi, but I'm trying to find a way to do it without changing Table 1.
I already wrote macro that adds "vlookup" column to Table 1, but if it is
possible to get a result without changing Table 1 (using formula) my life
would be much easier. (Actually I wrote function that works fine but it is
quiet slow so I'm trying to find a way to do it using excel functions.)

Thanks anyway,
Oscar.

"Stefi" wrote:

Add a helper column C to Table 1, insert this formula in C2:
=VLOOKUP(A2,Table2!A:B,2,FALSE)

Drag it down to C5 (or as it's necessary)!

Create Table 3:
Groups Sales by group
G_1 14(formula here)
G_2 7

Insert in B2:
=SUMPRODUCT(--(Table1!$C$2:$C$5=A2),Table1!$B$2:$B$5)
Drag it down as necessary!

Regards,
Stefi

€žOscar€ť ezt Ă*rta:

I have two tables:

Table 1:
Item Sales
I_1 5
I_2 7
I_1 3
I_3 6

Table 2:
Item Group
I_1 G_1
I_2 G_2
I_3 G_1

I have no problem to calculate sales of certain item
=SUMPRODUCT(--(A1:A5="I_1");B1:B5). But I dont know how to calculate sales of
items from certain group. I dont want to manipulate table 1 because I get one
table like this every day. Any help appreciated.

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? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
Sumproduct jcastellano Excel Worksheet Functions 3 March 15th 06 02:10 PM
Need help with SUMPRODUCT Looney Excel Discussion (Misc queries) 1 March 13th 06 10:16 PM
sumproduct Firman-EID Excel Discussion (Misc queries) 1 March 13th 06 05:04 AM
SUMPRODUCT - Help ceemo Excel Worksheet Functions 16 February 28th 06 02:07 PM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"