Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Martin M
 
Posts: n/a
Default Difficulties with COUNTIF.

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin
  #2   Report Post  
bj
 
Posts: n/a
Default

You probably have two criteria for selection. one to select which cells to
look at and one to decide whether to count that cell. If this is the case
sumproduct will work
=sumproduct(--(range criteria one),--(range criteria two))

"Martin M" wrote:

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin

  #3   Report Post  
Martin M
 
Posts: n/a
Default

Thanks bj.

I've had a go with sumproduct, but without any success. Partly it's cos I'm
not sure how to properly interpret what you wrote, but also because I think
that sumproduct works with numbers rather than text (although I may well be
completely wrong about that).

I'm going to post another message with a more informative subject heading
and see if I get anywhere with that.

Thanks for your prompt help anyway, Martin.

"bj" wrote:

You probably have two criteria for selection. one to select which cells to
look at and one to decide whether to count that cell. If this is the case
sumproduct will work
=sumproduct(--(range criteria one),--(range criteria two))

"Martin M" wrote:

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin

  #4   Report Post  
bj
 
Posts: n/a
Default

sumproduct does work with text.
do you have a criteria which selects what cells you want to look at to
decide if you want to count it.?

"Martin M" wrote:

Thanks bj.

I've had a go with sumproduct, but without any success. Partly it's cos I'm
not sure how to properly interpret what you wrote, but also because I think
that sumproduct works with numbers rather than text (although I may well be
completely wrong about that).

I'm going to post another message with a more informative subject heading
and see if I get anywhere with that.

Thanks for your prompt help anyway, Martin.

"bj" wrote:

You probably have two criteria for selection. one to select which cells to
look at and one to decide whether to count that cell. If this is the case
sumproduct will work
=sumproduct(--(range criteria one),--(range criteria two))

"Martin M" wrote:

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin

  #5   Report Post  
Martin M
 
Posts: n/a
Default

Hi bj. The formula I've been using is

=COUNTIF(B2,B4,B7:B11,B14,"E")

Excel then tells me that I've used too many arguements, despite that style
of formula working for SUM to add up numbers.

I hope that answers your question and that'll help you be able to answer my
original question

Thanks again, Martin

"bj" wrote:

sumproduct does work with text.
do you have a criteria which selects what cells you want to look at to
decide if you want to count it.?

"Martin M" wrote:

Thanks bj.

I've had a go with sumproduct, but without any success. Partly it's cos I'm
not sure how to properly interpret what you wrote, but also because I think
that sumproduct works with numbers rather than text (although I may well be
completely wrong about that).

I'm going to post another message with a more informative subject heading
and see if I get anywhere with that.

Thanks for your prompt help anyway, Martin.

"bj" wrote:

You probably have two criteria for selection. one to select which cells to
look at and one to decide whether to count that cell. If this is the case
sumproduct will work
=sumproduct(--(range criteria one),--(range criteria two))

"Martin M" wrote:

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin



  #6   Report Post  
Martin M
 
Posts: n/a
Default

Hi again bj. I've managed to work out how to do what I want to do. I've used
=SUM(countif(b4,"e"),countif(b7:b10,"e"),countif(b 13,"e")) etc. A bit long
winded but it works.

Again, cheers for your help,

Martin



"bj" wrote:

sumproduct does work with text.
do you have a criteria which selects what cells you want to look at to
decide if you want to count it.?

"Martin M" wrote:

Thanks bj.

I've had a go with sumproduct, but without any success. Partly it's cos I'm
not sure how to properly interpret what you wrote, but also because I think
that sumproduct works with numbers rather than text (although I may well be
completely wrong about that).

I'm going to post another message with a more informative subject heading
and see if I get anywhere with that.

Thanks for your prompt help anyway, Martin.

"bj" wrote:

You probably have two criteria for selection. one to select which cells to
look at and one to decide whether to count that cell. If this is the case
sumproduct will work
=sumproduct(--(range criteria one),--(range criteria two))

"Martin M" wrote:

Hello. I'm trying to add the number of times a certain piece of text occurs
in a column. I can use COUNTIF when I'm only looking at a sequential column
of cells eg B2:B9, but not when they're not sequential eg B2, B5, B8:B11, B13
etc. Excel just won't let me do and I can't work out why! If anyone has any
idea how to sort this, it would make doing the rotas for work much easier.

Many Thanks, Martin

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
COUNTIF COMBINATION?? Heather Excel Worksheet Functions 1 April 26th 05 02:44 AM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM
countif, again Liz G Excel Worksheet Functions 2 November 1st 04 11:20 PM


All times are GMT +1. The time now is 07:21 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"