LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting a series of text and/or numbers within columns

Try these array formulas** :

Count 2 consecutive Ws:

=SUM(--(FREQUENCY(IF(B2:B9="w",ROW(B2:B9)),IF(B2:B9<"w", ROW(B2:B9)))=2))

Count 3 consecutive 0s. Assumes no empty cells within the range. Empty cells
evaluate as 0 and could cause incorrect results. If there might be empty
cells the formula can be tweaked to account for them.

=SUM(--(FREQUENCY(IF(A2:A9=0,ROW(A2:A9)),IF(A2:A9<0,ROW( A2:A9)))=3))

Note that these formulas are explicit in how they count.

W
W
W
W

That would not be counted as 2 instances of 2 consecutive Ws. That is
considered 1 instance of 4 consecutive Ws.

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"andrew" wrote in message
...
I have the following table:

A B
0 W
1 W
0 D
0 W
0 D
1 W
0 W
1 D

Is there a way to count or sum up a series of text or number within a
column? E.g.
i) count the number of times the alphabet W appears in sequence of 2 times
(i.e. B2 and B3 in a column)? Table above shows W appearing twice in
sequence.
ii) count the number of times the number zero (0) appears in a sequence of
3
times within a column?

Appreciate any help, thanks!



 
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 up with numbers and text pwalters Excel Worksheet Functions 7 June 20th 07 08:59 AM
Maximum Numbers from a series of Columns [email protected] Excel Discussion (Misc queries) 4 February 21st 07 03:29 AM
counting if two columns contain the same numbers aurion22 Excel Worksheet Functions 2 February 27th 06 02:25 PM
Counting differences in numbers across columns Ted Metro Excel Worksheet Functions 3 March 11th 05 09:50 PM
Counting Numbers with Text scottymelloty Excel Worksheet Functions 6 November 22nd 04 08:31 PM


All times are GMT +1. The time now is 11:51 AM.

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"