View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default string lookup combined with SUM

Assuming that there is always a description followed by a space and then the
word cat:

=SUMIF(A1:A10,"* cat",B1:B10)

Or, use a cell to hold the word cat:

D1 = cat

=SUMIF(A1:A4,"* "&D1,B1:B4)

You could also use:

=SUMIF(A1:A4,"*cat",B1:B4)

Or:

=SUMIF(A1:A4,"*cat*",B1:B4)

But these are more prone to "false positives".

So, which is best depends on the variety of entries that you have.

--
Biff
Microsoft Excel MVP


"bestrugger" wrote in message
...
Hi, can someone offer any suggestions on how to add up some values based
on a
column that contains a word that I specify. For example:

Brown Cat 2
Brown Dog 3
Tabby Cat 2
Red Dog 4

What function can i use to add up on the those columns that contain "cat"?
Thanks in advance.

DP