Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default string lookup combined with SUM

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default string lookup combined with SUM

Try this:

=SUMPRODUCT((ISNUMBER(SEARCH("cat",A1:A4)))*(B1:B4 ))

this adds up the rows that contain cat.

Hope this helps.

Pete

On Jul 2, 6:50*pm, bestrugger
wrote:
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


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default string lookup combined with SUM

You're awesome. Works like a champ!!!!!!!

"Pete_UK" wrote:

Try this:

=SUMPRODUCT((ISNUMBER(SEARCH("cat",A1:A4)))*(B1:B4 ))

this adds up the rows that contain cat.

Hope this helps.

Pete

On Jul 2, 6:50 pm, bestrugger
wrote:
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



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default string lookup combined with SUM

Well, thanks for feeding back.

Pete

On Jul 2, 7:31*pm, bestrugger
wrote:
You're awesome. *Works like a champ!!!!!!!

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
lookup a value within a text string Henrik Excel Worksheet Functions 5 March 12th 08 01:10 PM
IF and lookup functions combined? RSS Excel Worksheet Functions 4 January 18th 07 01:04 AM
IF and lookup functions combined? RSS Excel Worksheet Functions 1 January 17th 07 02:00 PM
Array formula combined with Lookup Kevin Gallagher Excel Discussion (Misc queries) 9 March 2nd 06 06:47 AM
Lookup the month in a date string 01/03/05 Una Excel Worksheet Functions 1 March 30th 05 09:45 AM


All times are GMT +1. The time now is 08:05 AM.

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"