Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
aet999
 
Posts: n/a
Default Count text cells based on two criteria

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A contains
names of girls (amy, betty, susie, karen, betty) and column B contains names
of boys (michael, robert, andrew, james, joseph). how many times does column
A = betty AND column b = robert on the same row? In this example, the answer
would be one.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tom Ogilvy
 
Posts: n/a
Default Count text cells based on two criteria

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A contains
names of girls (amy, betty, susie, karen, betty) and column B contains names
of boys (michael, robert, andrew, james, joseph). how many times does column
A = betty AND column b = robert on the same row? In this example, the answer
would be one.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
aet999
 
Posts: n/a
Default Count text cells based on two criteria

It worked. Thanks. You rock!

"Tom Ogilvy" wrote:

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A contains
names of girls (amy, betty, susie, karen, betty) and column B contains names
of boys (michael, robert, andrew, james, joseph). how many times does column
A = betty AND column b = robert on the same row? In this example, the answer
would be one.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 191
Default Count text cells based on two criteria

guys,
this works well, but If there's a wild card in the formula it doesn't work.

For example:
=Sumproduct(--(A1:A100="betty"),--(B1:B100="*robert*"))


thanks,




"Tom Ogilvy" wrote:

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A contains
names of girls (amy, betty, susie, karen, betty) and column B contains names
of boys (michael, robert, andrew, james, joseph). how many times does column
A = betty AND column b = robert on the same row? In this example, the answer
would be one.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count text cells based on two criteria

SUMPRODUCT doesn't work with wild cards.

Try it like this:

=SUMPRODUCT(--(A1:A100="betty"),--(ISNUMBER(SEARCH("robert",B1:B100))))

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
guys,
this works well, but If there's a wild card in the formula it doesn't
work.

For example:
=Sumproduct(--(A1:A100="betty"),--(B1:B100="*robert*"))


thanks,




"Tom Ogilvy" wrote:

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A
contains
names of girls (amy, betty, susie, karen, betty) and column B contains
names
of boys (michael, robert, andrew, james, joseph). how many times does
column
A = betty AND column b = robert on the same row? In this example, the
answer
would be one.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 191
Default Count text cells based on two criteria

IT WORKED!!!!
THANK YOU!


"T. Valko" wrote:

SUMPRODUCT doesn't work with wild cards.

Try it like this:

=SUMPRODUCT(--(A1:A100="betty"),--(ISNUMBER(SEARCH("robert",B1:B100))))

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
guys,
this works well, but If there's a wild card in the formula it doesn't
work.

For example:
=Sumproduct(--(A1:A100="betty"),--(B1:B100="*robert*"))


thanks,




"Tom Ogilvy" wrote:

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how many
occurances there are of two criteria matching. Example, If column A
contains
names of girls (amy, betty, susie, karen, betty) and column B contains
names
of boys (michael, robert, andrew, james, joseph). how many times does
column
A = betty AND column b = robert on the same row? In this example, the
answer
would be one.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count text cells based on two criteria

Be advised that one of the pitfalls of this type of string matching is the
possibility of "false positives".

--(ISNUMBER(SEARCH("robert",B1:B100)))

That will find:

robert
roberta
roberts
robertson

Basically *anything* that contains the substring "robert".

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
IT WORKED!!!!
THANK YOU!


"T. Valko" wrote:

SUMPRODUCT doesn't work with wild cards.

Try it like this:

=SUMPRODUCT(--(A1:A100="betty"),--(ISNUMBER(SEARCH("robert",B1:B100))))

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
guys,
this works well, but If there's a wild card in the formula it doesn't
work.

For example:
=Sumproduct(--(A1:A100="betty"),--(B1:B100="*robert*"))

thanks,




"Tom Ogilvy" wrote:

=Sumproduct(--(A1:A100="betty"),--(B1:B100="robert"))

--
Regards,
Tom Ogilvy


"aet999" wrote:

I have a spreadsheet with many columns. I would like to count how
many
occurances there are of two criteria matching. Example, If column A
contains
names of girls (amy, betty, susie, karen, betty) and column B
contains
names
of boys (michael, robert, andrew, james, joseph). how many times
does
column
A = betty AND column b = robert on the same row? In this example,
the
answer
would be one.






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
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM
counting cells (COUNTIF) based on two or more criteria Tricia S. Excel Worksheet Functions 10 March 17th 05 02:17 PM
count non blank cells which meet criteria in another column cmarsh5035 Excel Worksheet Functions 2 February 16th 05 04:32 PM
Counting rows based on criteria in multiple cells Margaret Excel Discussion (Misc queries) 11 December 2nd 04 11:04 PM
conditional formating - Highlighting text cells based on sales res ANDREW_B Excel Discussion (Misc queries) 7 December 2nd 04 04:27 PM


All times are GMT +1. The time now is 04:30 PM.

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"