Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 860
Default Consecutive repetitions

Hi Eco,

Try this in C2 and drag down as far as is needed.
=COUNTIF($B$2:B2,B2)

HTH
Martin

"Eco" <ecologic1975arrobayahoo.com wrote in message
...
Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
....
..
.

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.





  #3   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

Hi MartinW, the repetitions must be "consecutive repetitions" if one day the
Item is no present de counter stops counting.

Extending the example for better understanding:

Date Item Counter
1-jun Item1 1
1-jun Item2 1
2-jun Item1 2
2-jun Item3 1
3-jun Item1 3
3-jun Item3 2
4-jun Item1 4
5-jun Item3 1 <-- Here, your option will say 3 but must be 1

Thanks anyway.

"MartinW" escribió en el mensaje
...
Hi Eco,

Try this in C2 and drag down as far as is needed.
=COUNTIF($B$2:B2,B2)

HTH
Martin

"Eco" <ecologic1975arrobayahoo.com wrote in message
...
Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
....
..
.

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.







  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default Consecutive repetitions

=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.




  #5   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

It Doesn't works, I think because in file 1 there are the tittles of each
column. I couldn't manage to adaptate it correctly.

Thanks anyway.

"Jerry W. Lewis" escribió en el mensaje
...
=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default Consecutive repetitions

Simply change $1 to $2 everywhere in the formula.

Jerry

"Eco" wrote:

It Doesn't works, I think because in file 1 there are the tittles of each
column. I couldn't manage to adaptate it correctly.

Thanks anyway.

"Jerry W. Lewis" escribió en el mensaje
...
=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.







  #7   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

Sorry:
It Doesn't works, I think because in *row 1 there are the tittles of each
column. I couldn't manage to adaptate it correctly.

Thanks anyway.

"Jerry W. Lewis" escribió en el mensaje
...
=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.








  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default Consecutive repetitions

Actually, the outer IF() is unnecessary. You could reduce to simply
=SUMPRODUCT((A1:A$2=A2-1)*(B1:B$2=B2),C1:C$2)+1
in C2 and copied down.

Jerry

"Jerry W. Lewis" wrote:

Simply change $1 to $2 everywhere in the formula.

Jerry

"Eco" wrote:

It Doesn't works, I think because in file 1 there are the tittles of each
column. I couldn't manage to adaptate it correctly.

Thanks anyway.

"Jerry W. Lewis" escribió en el mensaje
...
=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.







  #9   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

Great! It really works!!! Thanks a lot Jerry. :)))


"Jerry W. Lewis" escribió en el mensaje
...
Simply change $1 to $2 everywhere in the formula.

Jerry

"Eco" wrote:

It Doesn't works, I think because in file 1 there are the tittles of each
column. I couldn't manage to adaptate it correctly.

Thanks anyway.

"Jerry W. Lewis" escribió en el mensaje
...
=IF(A2=A$1,1,SUMPRODUCT((A$1:A1=A2-1)*(B$1:B1=B2),C$1:C1)+1)
in C2 and copied down.

Jerry

"Eco" wrote:

Hi, I need a formula to count the number of times an Item is repeated
in
consecutive days from a list.

For example:
A B C
*******************
1 * Date Item Repeated
2 * 1-jun Item1 1
3 * 1-jun Item2 1
4 * 2-jun Item1 2
5 * 2-jun Item3 1
6 * 3-jun Item1 3
7 * 3-jun Item3 2
8 * 3-jun Item4 1
.....
...
..

NOTES:
- My list contains consecutive days including weekends.
- Each Item is not repeated in the same day.
- Each day, the number of Items appeared could be different.
- My list is ordered by date from the older to the newest.

Thanks in advance for your help.









  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default Consecutive repetitions

Correct in principle, but in practice you would get a circular reference in
C2. Instead start the formula in C3, where it becomes
=SUMPRODUCT((A$2:A2=A3-1)*(B$2:B2=B3),C$2:C2)+1
copy down, and manually fill C2 with 1.

Jerry

"Jerry W. Lewis" wrote:

Actually, the outer IF() is unnecessary. You could reduce to simply
=SUMPRODUCT((A1:A$2=A2-1)*(B1:B$2=B2),C1:C$2)+1
in C2 and copied down.

Jerry



  #11   Report Post  
Posted to microsoft.public.excel.misc
Eco Eco is offline
external usenet poster
 
Posts: 6
Default Consecutive repetitions

I'll take the advice Jerry, thank's again.


"Jerry W. Lewis" escribió en el mensaje
...
Correct in principle, but in practice you would get a circular reference
in
C2. Instead start the formula in C3, where it becomes
=SUMPRODUCT((A$2:A2=A3-1)*(B$2:B2=B3),C$2:C2)+1
copy down, and manually fill C2 with 1.

Jerry

"Jerry W. Lewis" wrote:

Actually, the outer IF() is unnecessary. You could reduce to simply
=SUMPRODUCT((A1:A$2=A2-1)*(B1:B$2=B2),C1:C$2)+1
in C2 and copied down.

Jerry



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
adding totals in a column, not counting repetitions in another col h20polo Excel Discussion (Misc queries) 1 June 6th 07 05:30 AM
consecutive gotta know Excel Worksheet Functions 1 December 31st 06 10:34 PM
Why do I get repetitions of characters in my cells? xlcj Excel Discussion (Misc queries) 3 May 13th 06 08:09 AM
consecutive numbering joan Excel Discussion (Misc queries) 1 November 16th 05 06:41 PM
consecutive numbers Monique Excel Worksheet Functions 8 March 7th 05 05:09 AM


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