#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default SUMPRODUCT help

I'm trying to use the SUMPRODUCT trick to count occurrences of multiple
match criteria.

With simple conditions like checking if a cell in a range is 0, the
trick works fine.
Even with LEFT, MID functions it works fine...

A2 = 1st criteria
B2 = 2nd criteroa
B50:Q800 = range of cells to search

=SUMPRODUCT(--(LEFT($B$50:$Q$800,1)=TEXT($A2,"0")),--(MID($B$50:$Q$800,3,3)=LEFT($B2,3)))
WORKS <<<


What I can't get to work is if I want to use the FIND (or SEARCH) as
one of the criteria to see if each cell contain the search text:

=SUMPRODUCT(--(FIND($B2,$B50:$Q800)0))
DOESN'T WORK <<<


Are there only certain functions that work with the SUMPRODUCT trick?
Any Ideas on how to do a search text as part of a SUMPRODUCT criteria?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default SUMPRODUCT help

Wrap SUMPRODUCT in an IF function: =IF(B2=[your criteria],SUMPRODUCT([your
criteria]),"")

Dave
--
Brevity is the soul of wit.


" wrote:

I'm trying to use the SUMPRODUCT trick to count occurrences of multiple
match criteria.

With simple conditions like checking if a cell in a range is 0, the
trick works fine.
Even with LEFT, MID functions it works fine...

A2 = 1st criteria
B2 = 2nd criteroa
B50:Q800 = range of cells to search

=SUMPRODUCT(--(LEFT($B$50:$Q$800,1)=TEXT($A2,"0")),--(MID($B$50:$Q$800,3,3)=LEFT($B2,3)))
WORKS <<<


What I can't get to work is if I want to use the FIND (or SEARCH) as
one of the criteria to see if each cell contain the search text:

=SUMPRODUCT(--(FIND($B2,$B50:$Q800)0))
DOESN'T WORK <<<


Are there only certain functions that work with the SUMPRODUCT trick?
Any Ideas on how to do a search text as part of a SUMPRODUCT criteria?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 111
Default SUMPRODUCT help

The following appears to work:

=SUMPRODUCT(--ISNUMBER(FIND("blah",A1:A10)))

Note, I did not use your range or criteria, but I believe you were mainly
interested in the concept.
--
Kevin Vaughn


" wrote:

I'm trying to use the SUMPRODUCT trick to count occurrences of multiple
match criteria.

With simple conditions like checking if a cell in a range is 0, the
trick works fine.
Even with LEFT, MID functions it works fine...

A2 = 1st criteria
B2 = 2nd criteroa
B50:Q800 = range of cells to search

=SUMPRODUCT(--(LEFT($B$50:$Q$800,1)=TEXT($A2,"0")),--(MID($B$50:$Q$800,3,3)=LEFT($B2,3)))
WORKS <<<


What I can't get to work is if I want to use the FIND (or SEARCH) as
one of the criteria to see if each cell contain the search text:

=SUMPRODUCT(--(FIND($B2,$B50:$Q800)0))
DOESN'T WORK <<<


Are there only certain functions that work with the SUMPRODUCT trick?
Any Ideas on how to do a search text as part of a SUMPRODUCT criteria?

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default SUMPRODUCT help

The FIND will return a number if it matches, an error if not. SO wrap it in
ISNUMBER to check if it is a number, and you'll get your TRUE/FALSE values
to coerce in SP.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
I'm trying to use the SUMPRODUCT trick to count occurrences of multiple
match criteria.

With simple conditions like checking if a cell in a range is 0, the
trick works fine.
Even with LEFT, MID functions it works fine...

A2 = 1st criteria
B2 = 2nd criteroa
B50:Q800 = range of cells to search


=SUMPRODUCT(--(LEFT($B$50:$Q$800,1)=TEXT($A2,"0")),--(MID($B$50:$Q$800,3,3)=
LEFT($B2,3)))
WORKS <<<


What I can't get to work is if I want to use the FIND (or SEARCH) as
one of the criteria to see if each cell contain the search text:

=SUMPRODUCT(--(FIND($B2,$B50:$Q800)0))
DOESN'T WORK <<<


Are there only certain functions that work with the SUMPRODUCT trick?
Any Ideas on how to do a search text as part of a SUMPRODUCT criteria?

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
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
Need help with sumproduct & dynamic ranges bill_s1416 Excel Worksheet Functions 1 March 19th 06 03:36 AM
Can I reference =, <, or > sign in SUMPRODUCT BobT Excel Discussion (Misc queries) 7 February 16th 05 01:58 PM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


All times are GMT +1. The time now is 02:27 PM.

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"