Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Counting Inbetween Spaces

If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.
  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Counting Inbetween Spaces

one way you could try, assuming the data begins in cell A1. if not, change
the cell references:

=IF(A2="",SUMPRODUCT(--(ROW(A$1:A1)=MAX((A$1:A1="")*(ROW(A$1:A1)),1)),A$ 1:A1),"")


entered normally


"Peter" wrote:

If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

One way...

This requires that the cell immediately above the data is empty and the next
cell after the last entry is empty. So,assuming your data starts in cell A2
with cell A1 being empty.

Enter this formula in B2 and copy down as needed:

=IF(A2="","",IF(A3="",COUNT(A2:INDEX(A$1:A1,LOOKUP (2,1/(A$1:A1=""),ROW(A$1:A1)))),""))

--
Biff
Microsoft Excel MVP


"Peter" wrote in message
...
If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

Improvement...

This formula doesn't require the cell immediately above the data be empty.

Assuming data starts in A2.

=IF(A3="",COUNT(A2:INDEX(A$2:A2,MAX(INDEX((A$2:A2= "")*ROW(A$2:A2),,1)))),"")

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
One way...

This requires that the cell immediately above the data is empty and the
next cell after the last entry is empty. So,assuming your data starts in
cell A2 with cell A1 being empty.

Enter this formula in B2 and copy down as needed:

=IF(A2="","",IF(A3="",COUNT(A2:INDEX(A$1:A1,LOOKUP (2,1/(A$1:A1=""),ROW(A$1:A1)))),""))

--
Biff
Microsoft Excel MVP


"Peter" wrote in message
...
If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Counting Inbetween Spaces

Hi and thanks for the formula. I tried dragging it down after
changing the references, but after the first group of numbers it
doesn't correctly count from then on. Pilot error?

On Fri, 14 Dec 2007 00:05:06 -0500, "T. Valko"
wrote:

Improvement...

This formula doesn't require the cell immediately above the data be empty.

Assuming data starts in A2.

=IF(A3="",COUNT(A2:INDEX(A$2:A2,MAX(INDEX((A$2:A2 ="")*ROW(A$2:A2),,1)))),"")




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

Works for me. See this screencap:

http://img205.imageshack.us/img205/3...tconsecpt0.jpg

after changing the references


If it doesn't work tell me where the data is. Is there more than one empty
cell between any group?

--
Biff
Microsoft Excel MVP


"Peter" wrote in message
...
Hi and thanks for the formula. I tried dragging it down after
changing the references, but after the first group of numbers it
doesn't correctly count from then on. Pilot error?

On Fri, 14 Dec 2007 00:05:06 -0500, "T. Valko"
wrote:

Improvement...

This formula doesn't require the cell immediately above the data be empty.

Assuming data starts in A2.

=IF(A3="",COUNT(A2:INDEX(A$2:A2,MAX(INDEX((A$2:A 2="")*ROW(A$2:A2),,1)))),"")




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Counting Inbetween Spaces

Hi, it works for me to if I insert it into a blank page and start
fresh. In my spreadsheet, no.

There is not more than one empty cell between any group. So far I
only have three groups. The first one has 14 entries and the next two
each have 27, but it says there are 19 for the last two groups.

I'm assuming it doesn't make any difference how many columns there are
between the data and the count, but in case it did make a difference
I just counted a column that was adjacent.

Very perplexing.

On Fri, 14 Dec 2007 01:09:01 -0500, "T. Valko"
wrote:

Works for me. See this screencap:

http://img205.imageshack.us/img205/3...tconsecpt0.jpg

after changing the references


If it doesn't work tell me where the data is. Is there more than one empty
cell between any group?


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

It's also a little easier to understand than what has been posted
previously.


Yeah, you got that right!

Nice and simple. I'm calling it a day!

--
Biff
Microsoft Excel MVP


"g-" wrote in message
...
If your data starts in A2 then put this formula in B2:

=IF(A3="",COUNT(A$2:A2)-SUM(B1:B$2),"")

Copy this formula down and you'll get what you need.

It's also a little easier to understand than what has been posted
previously.

g-

___________________________________

Need holiday money. Got any jobs, big or small, drop me a line! Thanks!





"Peter" wrote in message
...
If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.





  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

See g-'s reply.

Nice and simple!

--
Biff
Microsoft Excel MVP


"Peter" wrote in message
...
Hi, it works for me to if I insert it into a blank page and start
fresh. In my spreadsheet, no.

There is not more than one empty cell between any group. So far I
only have three groups. The first one has 14 entries and the next two
each have 27, but it says there are 19 for the last two groups.

I'm assuming it doesn't make any difference how many columns there are
between the data and the count, but in case it did make a difference
I just counted a column that was adjacent.

Very perplexing.

On Fri, 14 Dec 2007 01:09:01 -0500, "T. Valko"
wrote:

Works for me. See this screencap:

http://img205.imageshack.us/img205/3...tconsecpt0.jpg

after changing the references


If it doesn't work tell me where the data is. Is there more than one empty
cell between any group?






  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting Inbetween Spaces

If your data starts in A2 then put this formula in B2:

=IF(A3="",COUNT(A$2:A2)-SUM(B1:B$2),"")


That works just fine as long as the data doesn't start in row 1.


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
It's also a little easier to understand than what has been posted
previously.


Yeah, you got that right!

Nice and simple. I'm calling it a day!

--
Biff
Microsoft Excel MVP


"g-" wrote in message
...
If your data starts in A2 then put this formula in B2:

=IF(A3="",COUNT(A$2:A2)-SUM(B1:B$2),"")

Copy this formula down and you'll get what you need.

It's also a little easier to understand than what has been posted
previously.

g-

___________________________________

Need holiday money. Got any jobs, big or small, drop me a line! Thanks!





"Peter" wrote in message
...
If I have a column that likes like this:

5
5
6
2 4

2
3
2 3

1 1

2
3
1 3


I want to count each the number of items in each group and have it
show up next to it's group as in the example. I assume it's some kind
of array formula similar to summing the numbers in each group.

Thanks very much for all of the help. I really do appreciate it.
This is great group.







  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Counting Inbetween Spaces

That worked. Thanks guys.

On Fri, 14 Dec 2007 02:45:23 -0500, "T. Valko"
wrote:

If your data starts in A2 then put this formula in B2:


=IF(A3="",COUNT(A$2:A2)-SUM(B1:B$2),"")


That works just fine as long as the data doesn't start in row 1.


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
how do I remove leading spaces and leave the remianing spaces w Debi Excel Worksheet Functions 6 February 28th 07 03:29 PM
NEED TO SHOW EACH DAY INBETWEEN TWO DATES, help please lost soul Excel Worksheet Functions 2 September 13th 06 02:23 PM
Using IF function for inbetween cell values Ivano Excel Worksheet Functions 5 March 31st 06 03:35 PM
How can I add rows inbetween? dhjacha Excel Worksheet Functions 6 January 10th 06 07:06 PM
How do I enter a row inbetween two rows? Acesmith Excel Discussion (Misc queries) 2 December 1st 04 01:17 PM


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