Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 142
Default counting every other cell containing text

I have a long spreadsheet and I have several columns that have text. These
cells are not consecutive but is like every fourth cell and I have to count
them to perform operations like calculating percentages. If i pick a range
of cells (i.e. c6:cu6) the results are going to be wrong because along the
range are other cells that may have the same content.
a b c d e f g h i j k l m n o
0 5 N N Y 7 3 Y N N 6 7 Y N Y
now I want to count c, h, m and do some sort of computation such as
=countif(c,h,m,"Y")
Your assistance is greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default counting every other cell containing text

Try this:

=SUMPRODUCT(--(MOD(COLUMN(C6:CU6),5)=3),--(C6:CU6="Y"))

--
Biff
Microsoft Excel MVP


"Jerry" wrote in message
...
I have a long spreadsheet and I have several columns that have text.
These
cells are not consecutive but is like every fourth cell and I have to
count
them to perform operations like calculating percentages. If i pick a
range
of cells (i.e. c6:cu6) the results are going to be wrong because along
the
range are other cells that may have the same content.
a b c d e f g h i j k l m n o
0 5 N N Y 7 3 Y N N 6 7 Y N Y
now I want to count c, h, m and do some sort of computation such as
=countif(c,h,m,"Y")
Your assistance is greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default counting every other cell containing text

.. cells are not consecutive but is like every fourth cell
=countif(c,h,m,"Y")


Assuming data is in row 2 down,
this expression should achieve the indicative "countif" above,
placed in say, P2:
=SUMPRODUCT((MOD(COLUMN(C2:M2),5)=3)*(C2:M2="Y"))
Copy P2 down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Jerry" wrote:
I have a long spreadsheet and I have several columns that have text. These
cells are not consecutive but is like every fourth cell and I have to count
them to perform operations like calculating percentages. If i pick a range
of cells (i.e. c6:cu6) the results are going to be wrong because along the
range are other cells that may have the same content.
a b c d e f g h i j k l m n o
0 5 N N Y 7 3 Y N N 6 7 Y N Y
now I want to count c, h, m and do some sort of computation such as
=countif(c,h,m,"Y")
Your assistance is greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 142
Default counting every other cell containing text

What are the 5 and 3 in the column side. Is the 5 the size of the block I am
reading and the 3 the third element of that array? I am asking this because
I have to perform the same operation on the following 2 columns. It worked
fine for the first element that I picked up but it does not work for the next
set of columns.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(MOD(COLUMN(C6:CU6),5)=3),--(C6:CU6="Y"))

--
Biff
Microsoft Excel MVP


"Jerry" wrote in message
...
I have a long spreadsheet and I have several columns that have text.
These
cells are not consecutive but is like every fourth cell and I have to
count
them to perform operations like calculating percentages. If i pick a
range
of cells (i.e. c6:cu6) the results are going to be wrong because along
the
range are other cells that may have the same content.
a b c d e f g h i j k l m n o
0 5 N N Y 7 3 Y N N 6 7 Y N Y
now I want to count c, h, m and do some sort of computation such as
=countif(c,h,m,"Y")
Your assistance is greatly appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default counting every other cell containing text

What are the 5 and 3 in the column side.
Is the 5 the size of the block I am reading
and the 3 the third element of that array?


No.

We need to find a pattern that we can apply to the range of cells that tells
the formula which cells in the range to calculate. To see the pattern try
this:

Enter this formula in C1 and copy across to N1.

=MOD(COLUMN(),5)

Your range of interest was columns C, H, M etc. Do you see the pattern
returned by the above formula? The common criteria of that pattern is the
number 3. So, we tell the formula to calculate only those cells related to
3.



--
Biff
Microsoft Excel MVP


"Jerry" wrote in message
...
What are the 5 and 3 in the column side. Is the 5 the size of the block I
am
reading and the 3 the third element of that array? I am asking this
because
I have to perform the same operation on the following 2 columns. It
worked
fine for the first element that I picked up but it does not work for the
next
set of columns.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(MOD(COLUMN(C6:CU6),5)=3),--(C6:CU6="Y"))

--
Biff
Microsoft Excel MVP


"Jerry" wrote in message
...
I have a long spreadsheet and I have several columns that have text.
These
cells are not consecutive but is like every fourth cell and I have to
count
them to perform operations like calculating percentages. If i pick a
range
of cells (i.e. c6:cu6) the results are going to be wrong because along
the
range are other cells that may have the same content.
a b c d e f g h i j k l m n o
0 5 N N Y 7 3 Y N N 6 7 Y N Y
now I want to count c, h, m and do some sort of computation such as
=countif(c,h,m,"Y")
Your assistance is greatly appreciated.






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
Counting the number of specified text characters within a cell FlipperT Excel Worksheet Functions 3 December 1st 06 07:50 PM
Counting number of cells that contain certain text but not cell tw JRD Excel Worksheet Functions 1 September 11th 06 09:50 PM
counting text example of a cell with multiple words inside steveo Excel Discussion (Misc queries) 0 June 6th 06 03:30 AM
cell formula for counting instances of text? Samuel Excel Discussion (Misc queries) 12 May 24th 06 01:41 PM
Counting specific text in a cell Steve Excel Worksheet Functions 7 January 26th 05 05:51 PM


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