Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default SUMPRODUCT() challenge - How to integrate a string value in lieu of a value in a cell .....

2003 & 2007


=SUMPRODUCT(($D$1:$D$2=$A2)*($R$1:$R$2=$B$2)) ... the :Rx" and "Bx" values are standard and OK.

D1 = "qwerty IHN zxcv"
D2 = "qwerty zxcv IHN"

A2 cell value = "*IHN*"

If I use =COUNTIF($D$1:$D$2,"*IHN*") the formula works as it correctly yields 2

Is there a way to make SUMPRODUCT(($D$1:$D$2=$A2)*($R$1:$R$2=$B$2)) work
(or get the same end result) if one could:

SUMPRODUCT(("*IHN*")*($R$1:$R$2=$B$2)) I know it does not work.

In short, how can I get a multi-criteria COUNTIF if "IHN" is anywhere in each cell value?

TIA EagleOne
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default SUMPRODUCT() challenge - How to integrate a string value in lieu of a value in a cell .....

Perfect!

In bed, I thought about using Search or Find integrated into an "IF" statement to force either a
"0" or "1" all the while concerned whether a no-find threw a 0 or an error (which would blow it up).

Your use of ISNUMERIC is very clever.

In the end, this is how I deployed it:

=SUMPRODUCT((ISNUMBER(SEARCH("IHN",$D$2:$D$1745))) *($R$2:$R$1745=$B$1795))

Thanks for your help now and over time!

EagleOne

Ron Rosenfeld wrote:

On Fri, 14 Aug 2009 20:56:15 -0400, wrote:

2003 & 2007


=SUMPRODUCT(($D$1:$D$2=$A2)*($R$1:$R$2=$B$2)) ... the :Rx" and "Bx" values are standard and OK.

D1 = "qwerty IHN zxcv"
D2 = "qwerty zxcv IHN"

A2 cell value = "*IHN*"

If I use =COUNTIF($D$1:$D$2,"*IHN*") the formula works as it correctly yields 2

Is there a way to make SUMPRODUCT(($D$1:$D$2=$A2)*($R$1:$R$2=$B$2)) work
(or get the same end result) if one could:

SUMPRODUCT(("*IHN*")*($R$1:$R$2=$B$2)) I know it does not work.

In short, how can I get a multi-criteria COUNTIF if "IHN" is anywhere in each cell value?

TIA EagleOne


=SUMPRODUCT(--ISNUMBER(SEARCH(A2,D1:D2)))

BUT A2="IHN" (no asterisks).


SEARCH(A2,D1:D2) will return an error if IHN is NOT present. So we use
ISNUMBER to return either TRUE (IHN present) or FALSE (IHN not present).

Then the double unary transforms the boolean to 0 or 1; and SUMPRODUCT will add
up the ones -- e.g. give a count.

I'm not sure exactly how you are trying to combine things, but some variant of:

=SUMPRODUCT(ISNUMBER(SEARCH(A2,D1:D3))*ISNUMBER(S EARCH(A3,R1:R3)))

might return the results you are looking for.
--ron

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 containing txt string search sideshowjack Excel Worksheet Functions 6 July 7th 08 08:25 AM
SUMPRODUCT formula challenge Mitchell Excel Worksheet Functions 3 October 11th 06 01:02 PM
Sumproduct - Return a String carlyman Excel Discussion (Misc queries) 5 July 27th 05 02:11 AM
SUMPRODUCT and search string peacelittleone Excel Worksheet Functions 5 June 15th 05 03:24 PM
What does a "plus" cursor mean (in lieu of the pointer?)? thanks S. Hegge Excel Worksheet Functions 4 February 24th 05 03:38 PM


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