Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 395
Default Embed a 'match' statement in sumproduct?

Excel 2007
I'm trying to help a coworker who wants to generate a few summary pieces of
data (like a pivot table, but for only a few categories). The raw data
includes both valid and invalid product codes, so these summaries need to
exclude the rows with invalid codes and their associated data.

Sheet1: Location of this formula. Formula is looking for a total for a
specific location
Sheet2: Raw data including valid and invalid product code sales
Sheet3: List of invalid product codes

This formula works, but does not exclude the invalid products:
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1)
[Note: Sheet 1!F7 is the location code I'm trying to match]

So I try to add a match statement, to exclude invalid products (multiply
matches by zero):
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1,IF(ISERROR(MATCH('Sheet
2'!$G$2:$G$60000,Sheet3!B$1:B$100,0)),1,0)*1)

I can't tell if there is a problem in my syntax, or if Sumproduct
automatically thinks my match statement should be rows 2-60000 instead of
1-100, which would then mean it isn't working how I'd expect.

I welcome any suggestions!
Thank you,
Keith
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Embed a 'match' statement in sumproduct?

**Maybe** this...

=SUMPRODUCT(--('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7),
--(ISNA(MATCH('Sheet 2'!$G$2:$G$60000,Sheet3!B$1:B$100,0))),
'Sheet 2'!$I$2:$I$60000)

--
Biff
Microsoft Excel MVP


"ker_01" wrote in message
...
Excel 2007
I'm trying to help a coworker who wants to generate a few summary pieces
of
data (like a pivot table, but for only a few categories). The raw data
includes both valid and invalid product codes, so these summaries need to
exclude the rows with invalid codes and their associated data.

Sheet1: Location of this formula. Formula is looking for a total for a
specific location
Sheet2: Raw data including valid and invalid product code sales
Sheet3: List of invalid product codes

This formula works, but does not exclude the invalid products:
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1)
[Note: Sheet 1!F7 is the location code I'm trying to match]

So I try to add a match statement, to exclude invalid products (multiply
matches by zero):
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1,IF(ISERROR(MATCH('Sheet
2'!$G$2:$G$60000,Sheet3!B$1:B$100,0)),1,0)*1)

I can't tell if there is a problem in my syntax, or if Sumproduct
automatically thinks my match statement should be rows 2-60000 instead of
1-100, which would then mean it isn't working how I'd expect.

I welcome any suggestions!
Thank you,
Keith



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default Embed a 'match' statement in sumproduct?

Keith,

Try

=SUMPRODUCT((Sheet2!$C$2:$C$60000=Sheet1!$F7)*(ISE RROR(MATCH(Sheet2!$G$2:$G$60000,Sheet3!B$1:B$100,0 )))*(Sheet2!$I$2:$I$60000))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"ker_01" wrote in message
...
Excel 2007
I'm trying to help a coworker who wants to generate a few summary pieces
of
data (like a pivot table, but for only a few categories). The raw data
includes both valid and invalid product codes, so these summaries need to
exclude the rows with invalid codes and their associated data.

Sheet1: Location of this formula. Formula is looking for a total for a
specific location
Sheet2: Raw data including valid and invalid product code sales
Sheet3: List of invalid product codes

This formula works, but does not exclude the invalid products:
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1)
[Note: Sheet 1!F7 is the location code I'm trying to match]

So I try to add a match statement, to exclude invalid products (multiply
matches by zero):
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1,IF(ISERROR(MATCH('Sheet
2'!$G$2:$G$60000,Sheet3!B$1:B$100,0)),1,0)*1)

I can't tell if there is a problem in my syntax, or if Sumproduct
automatically thinks my match statement should be rows 2-60000 instead of
1-100, which would then mean it isn't working how I'd expect.

I welcome any suggestions!
Thank you,
Keith



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 395
Default Embed a 'match' statement in sumproduct?

Thank you Biff and Bob- you are lifesavers!
Keith

"Bob Phillips" wrote:

Keith,

Try

=SUMPRODUCT((Sheet2!$C$2:$C$60000=Sheet1!$F7)*(ISE RROR(MATCH(Sheet2!$G$2:$G$60000,Sheet3!B$1:B$100,0 )))*(Sheet2!$I$2:$I$60000))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"ker_01" wrote in message
...
Excel 2007
I'm trying to help a coworker who wants to generate a few summary pieces
of
data (like a pivot table, but for only a few categories). The raw data
includes both valid and invalid product codes, so these summaries need to
exclude the rows with invalid codes and their associated data.

Sheet1: Location of this formula. Formula is looking for a total for a
specific location
Sheet2: Raw data including valid and invalid product code sales
Sheet3: List of invalid product codes

This formula works, but does not exclude the invalid products:
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1)
[Note: Sheet 1!F7 is the location code I'm trying to match]

So I try to add a match statement, to exclude invalid products (multiply
matches by zero):
=SUMPRODUCT(('Sheet 2'!$C$2:$C$60000='Sheet 1'!$F7)*1,('Sheet
2'!$I$2:$I$60000)*1,IF(ISERROR(MATCH('Sheet
2'!$G$2:$G$60000,Sheet3!B$1:B$100,0)),1,0)*1)

I can't tell if there is a problem in my syntax, or if Sumproduct
automatically thinks my match statement should be rows 2-60000 instead of
1-100, which would then mean it isn't working how I'd expect.

I welcome any suggestions!
Thank you,
Keith



.

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
index, Match statement Bob Excel Worksheet Functions 2 August 20th 09 12:40 AM
Help with Vlookup Match and IF statement JessM Excel Worksheet Functions 2 February 10th 09 10:16 PM
Help with IF and VLookup Match Statement JessM Excel Worksheet Functions 1 February 10th 09 09:55 PM
sumproduct and if statement ellebelle Excel Worksheet Functions 8 July 3rd 07 09:10 AM
Sum within an Index Match Statement Mike The Newb Excel Discussion (Misc queries) 4 January 8th 07 09:46 PM


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