Wild card in formula

G

Greg Snidow

Greetings all. I am trying to use a SUMPRODUCT formula to calculate a
number, but I need to be able to use * or LIKE, or something with the same
results. I have the following, and of course it does not work

=SUMPRODUCT((A6:A100 = "*COURSES")*(B6:B100))

I will have several more columns involved once I get this part to work, thus
the SUMPRODUCT. Anyhow, I need it to sum B6:B100 where A6:A100 contains the
word "courses". I saw another post that kind of did something similar using
SEARCH(), but I could not get it to work. Thank you.

Greg
 
G

Greg Snidow

This is what I had in mind, but I can't get it to work:

=SUMPRODUCT((=IF(SEARCH("COURSES",A6:A100,1) <> 0,1,0))*(B6:B100))
 
T

Tom Hutchins

Try

=SUM(IF(ISERROR(SEARCH("COURSES",A6:A100)),0,B6:B100))

This is an array formula which must be entered with Ctrl+Shift+Enter and NOT
just by pressing Enter. If you do it correctly Excel will put curly brackets
around the formula {}. You can't type these yourself.

Hope this helps,

Hutch
 
G

Greg Snidow

Tom, that worked like a charm for just the two columns. Thank you. However,
I will need to include several more columns, so how could I incorporate this
using SUMPRODUCT?
 
G

Greg Snidow

I got it to work!

=SUMPRODUCT((IF(ISERROR(SEARCH("COURSES",A6:A100)),0,1)*(B6:B100)))
 
G

Greg Snidow

Dang it!!! I got it to work, but then I typed it again and I get the #N/A
error. Now when I type the exact same thing as I did first time, I get a
message saying "blah, blah...not enough parenthesis..." and it adds an extra
one at the end, and I can see it now where I copied and pasted below. Any
ideas? I am completely baffled.
 
G

Greg Snidow

I had some text at the bottom of the new sheet in column A that was messing
it up. No problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top