Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jazzman10
 
Posts: n/a
Default If two cells have specific text to count as 1

I want to count the number of times a row has two specific words, in two
different cells eg.
If column A contains the word 'Widget' and column B contains the word 'Sale'
I want to count the number of times this occurs.

I'm sure this is easy but I've spent hours trying to get it to work.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary L Brown
 
Posts: n/a
Default If two cells have specific text to count as 1

Check out Chip Pearson's Array Formula explanation...
http://www.cpearson.com/excel/array.htm

An array formula is created using Ctrl+Shift+Enter to surround the formula
with braces { }. You can't just type them :O.

Your formula would look something like...
{=SUM(IF($A1:$A1000="widget",1,0)*IF($B1:$B1000="s ale",1,0))}

Make sure you read Chip's site (above) to understand 'WHY' this works.
Otherwise I've given you a meal instead of helped you learn how to fish for
yourself.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Jazzman10" wrote:

I want to count the number of times a row has two specific words, in two
different cells eg.
If column A contains the word 'Widget' and column B contains the word 'Sale'
I want to count the number of times this occurs.

I'm sure this is easy but I've spent hours trying to get it to work.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jazzman10
 
Posts: n/a
Default If two cells have specific text to count as 1

Thanks for that - it works a treat and I read through Chip Pearson's array
formula explanation. However here's another question you might be able to
solve:

The formula works fine if put into a cell that hasn't been used before. But
if I try to enter (ctrl+shift+enter) it into a cell that has previously had a
deleted formula in it just puts the formula in without making it an array
formula (no {} either side) and won't work?

"Gary L Brown" wrote:

Check out Chip Pearson's Array Formula explanation...
http://www.cpearson.com/excel/array.htm

An array formula is created using Ctrl+Shift+Enter to surround the formula
with braces { }. You can't just type them :O.

Your formula would look something like...
{=SUM(IF($A1:$A1000="widget",1,0)*IF($B1:$B1000="s ale",1,0))}

Make sure you read Chip's site (above) to understand 'WHY' this works.
Otherwise I've given you a meal instead of helped you learn how to fish for
yourself.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Jazzman10" wrote:

I want to count the number of times a row has two specific words, in two
different cells eg.
If column A contains the word 'Widget' and column B contains the word 'Sale'
I want to count the number of times this occurs.

I'm sure this is easy but I've spent hours trying to get it to work.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default If two cells have specific text to count as 1


You could try a normal sumproduct and avoid the hassle of having to
worry about CTRL Shift and Enter

=SUMPRODUCT((A1:A1000="widget")*(B1:B1000="sale"))

Don't know about your missing {} in the array version. Wha happens if
you copy and paste the array formula?

Rgds


On Mon, 26 Jun 2006 07:59:01 -0700, Jazzman10
wrote:

Thanks for that - it works a treat and I read through Chip Pearson's array
formula explanation. However here's another question you might be able to
solve:

The formula works fine if put into a cell that hasn't been used before. But
if I try to enter (ctrl+shift+enter) it into a cell that has previously had a
deleted formula in it just puts the formula in without making it an array
formula (no {} either side) and won't work?

"Gary L Brown" wrote:

Check out Chip Pearson's Array Formula explanation...
http://www.cpearson.com/excel/array.htm

An array formula is created using Ctrl+Shift+Enter to surround the formula
with braces { }. You can't just type them :O.

Your formula would look something like...
{=SUM(IF($A1:$A1000="widget",1,0)*IF($B1:$B1000="s ale",1,0))}

Make sure you read Chip's site (above) to understand 'WHY' this works.
Otherwise I've given you a meal instead of helped you learn how to fish for
yourself.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Jazzman10" wrote:

I want to count the number of times a row has two specific words, in two
different cells eg.
If column A contains the word 'Widget' and column B contains the word 'Sale'
I want to count the number of times this occurs.

I'm sure this is easy but I've spent hours trying to get it to work.


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary L Brown
 
Posts: n/a
Default If two cells have specific text to count as 1

I can't duplicate your issue. It works first time, every time for me.

--
Gary Brown


"Jazzman10" wrote:

Thanks for that - it works a treat and I read through Chip Pearson's array
formula explanation. However here's another question you might be able to
solve:

The formula works fine if put into a cell that hasn't been used before. But
if I try to enter (ctrl+shift+enter) it into a cell that has previously had a
deleted formula in it just puts the formula in without making it an array
formula (no {} either side) and won't work?

"Gary L Brown" wrote:

Check out Chip Pearson's Array Formula explanation...
http://www.cpearson.com/excel/array.htm

An array formula is created using Ctrl+Shift+Enter to surround the formula
with braces { }. You can't just type them :O.

Your formula would look something like...
{=SUM(IF($A1:$A1000="widget",1,0)*IF($B1:$B1000="s ale",1,0))}

Make sure you read Chip's site (above) to understand 'WHY' this works.
Otherwise I've given you a meal instead of helped you learn how to fish for
yourself.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Jazzman10" wrote:

I want to count the number of times a row has two specific words, in two
different cells eg.
If column A contains the word 'Widget' and column B contains the word 'Sale'
I want to count the number of times this occurs.

I'm sure this is easy but I've spent hours trying to get it to work.

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
Can't see text in cells Alen K Excel Discussion (Misc queries) 3 June 14th 06 08:31 PM
formula to count cells containing #'s in a specific range woogiebooboo Excel Worksheet Functions 1 April 27th 06 08:23 PM
Count by Colour (Text) with other criteria Paul Sheppard Excel Discussion (Misc queries) 1 January 18th 06 03:41 PM
count cells that contain text entries Debi Excel Worksheet Functions 2 October 3rd 05 10:11 PM
How to count occcurence of specific text block in a column Anshuman Excel Discussion (Misc queries) 2 February 12th 05 12:55 PM


All times are GMT +1. The time now is 01:37 PM.

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"