Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Using a wild card in SUMPRODUCT

=SUMPRODUCT(--((D6:D1000="A/2-2 IN")+(E6:E1000="something else")+....

Yes, you would need it when testing different arrays for an "or" condition.
The OP is testing the same array for the "or" condition.

For the OP, here's how it works...

Let's assume you want to test A1 to see if it contains either an A or a B.

A1 can contain only one or the other, it can't can't contain both!

Let's assume A1 = A

(A1="A")+(A1="B")

(A1="A") = TRUE
(A1="B") = FALSE

TRUE + FALSE = 1

Now, let's assume A1 = B

(A1="A") = FALSE
(A1="B") = TRUE

FALSE + TRUE = 1

The result of the test can only be 1 or 0. So, in this case, testing for 0

--((A1="A")+(A1="B")0)

Is redundant since it will return the exact same result.

(A1="A")+(A1="B") = 1
--((A1="A")+(A1="B")0) = 1

Now, if you're testing different arrays for an "or" condition...

A1 or B1 = A

Let's assume both A1 and B1 = A

(A1="A")+(B1="A")

A1 = "A" = TRUE
B1 = "A" = TRUE

TRUE + TRUE = 2

Since this is an "or" condition you don't want the result to be counted
twice and that's where the test for 0 comes into play.

--((A1="A")+(B1="A")0) = 1

Hopefully, that will shed some light on it.


--
Biff
Microsoft Excel MVP


"Dave Peterson" wrote in message
...
But it gives me a feeling of safety.

If I gave that formula to someone who decided to include an additional
"or"
check in a different column, I'd want that "0" there.

=SUMPRODUCT(--((D6:D1000="A/2-2 IN")+(E6:E1000="something else")+....



Rasoul Khoshravan wrote:

On Feb 16, 8:04 am, Shane Devenshire
wrote:
Hi,

The SUMPRODUCT function does not support wildcards. Second problem is
that
*anything will return anything.

You could use something like this

=SUMPRODUCT(--((D6:D1000="A/2-2 IN")+(D6:D1000="B/2-2
IN")+(D6:D1000="C/2-2
IN")+(D6:D1000="D/2-2 IN")+(D6:D1000="E/2-2 IN")+(D6:D1000="HHC/2-2
IN")0),--(E6:E1000="NBI"))


Is there a reason to put 0. Traver's original question doesn't have
this criteria.


--

Dave Peterson



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
how do I use wild card in SUMPRODUCT formula? Foad Excel Worksheet Functions 4 October 21st 08 07:50 AM
wild card in sumproduct BNT1 via OfficeKB.com Excel Worksheet Functions 3 November 26th 07 04:10 AM
sumproduct with a search and wild card Scorpvin Excel Discussion (Misc queries) 1 June 14th 06 04:46 PM
Wild Card Search roy.okinawa Excel Worksheet Functions 4 January 30th 06 10:42 PM
Wild card * Herman Excel Worksheet Functions 0 October 21st 05 01:39 PM


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