Consecutive Sequence Count

KristinaPan

New Member
Joined
Sep 21, 2022
Messages
4
Platform
  1. MacOS
Hi everyone! I have been struggling with a specific scenario.
This is a large data sheet and I am trying to figure out consecutive purchases over the years. To identify consecutive length of purchases, which in my case is memberships.

The example shows that Customer1 has been a consecutive member for 1 year, whereas Customer2 is also been a member for 1 year only. Customer5 has been a member for 4 years and Customer6 has been a member for 2 years.

How do I best represent this without having to do manual data analysis. I have tried different functions etc and have completed the count. But cannot find out to do a consecutive count.

Any help is appreciated.

Thank you in adavance


Screen Shot 2022-09-21 at 9.39.29 AM.png
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try this:
Mrexcel_20220921.xlsx
ABCDEF
12019202020212022Consecutive
2Cust141
3Cust271
4Cust31253
5Cust4241
6Cust545484
7Cust6552
Sheet2
Cell Formulas
RangeFormula
F2:F7F2=MAX(FREQUENCY(IF(B2:E2<>"",COLUMN(B2:E2)),IF(B2:E2="",COLUMN(B2:E2))))

Depending on version of Excel, you may have to confirm formula as array formula...probably Command-Return on Mac (Ctrl-Shift-Enter on Windows).
 
Last edited:
Upvote 0
Solution
Try this:
Mrexcel_20220921.xlsx
ABCDEF
12019202020212022Consecutive
2Cust141
3Cust271
4Cust31253
5Cust4241
6Cust545484
7Cust6552
Sheet2
Cell Formulas
RangeFormula
F2:F7F2=MAX(FREQUENCY(IF(B2:E2<>"",COLUMN(B2:E2)),IF(B2:E2="",COLUMN(B2:E2))))

Depending on version of Excel, you may have to confirm formula as array formula...probably Command-Return on Mac (Ctrl-Shift-Enter on Windows).
This absolutely worked!!! Thank you so much, you have saved me tons of time of manual data analysis 🙏
 
Upvote 0
You're welcome...I'm happy to help.
Hey KRice, one more question, if it is ok to ask this way.

Last part of my analysis is to find out the last year a purchase was made. Really unsure what function will do this for me. Cust1 would be 2019 and Cust3 would be 2021.
 

Attachments

  • Screen Shot 2022-09-21 at 6.50.07 PM.png
    Screen Shot 2022-09-21 at 6.50.07 PM.png
    89.6 KB · Views: 2
Upvote 0
Here is one approach. What version of Excel are you using?...you should update your profile to show that, as optimal solutions often depend on the version. Two offerings depending on version:
Mrexcel_20220921.xlsx
ABCDEFGH
12019202020212022ConsecutiveMost RecentMost Recent with 365
2Cust14120192019
3Cust27120212021
4Cust3125320212021
5Cust424120222022
6Cust54548420222022
7Cust655220222022
Sheet2
Cell Formulas
RangeFormula
F2:F7F2=MAX(FREQUENCY(IF(B2:E2<>"",COLUMN(B2:E2)),IF(B2:E2="",COLUMN(B2:E2))))
G2:G7G2=INDEX($B$1:$E$1,LOOKUP(2,1/(B2:E2<>""),COLUMN(B:E)-COLUMN(B:B)+1))
H2:H7H2=XLOOKUP(1,--(B2:E2<>""),$B$1:$E$1,,0,-1)
 
Upvote 0
Here is one approach. What version of Excel are you using?...you should update your profile to show that, as optimal solutions often depend on the version. Two offerings depending on version:
Mrexcel_20220921.xlsx
ABCDEFGH
12019202020212022ConsecutiveMost RecentMost Recent with 365
2Cust14120192019
3Cust27120212021
4Cust3125320212021
5Cust424120222022
6Cust54548420222022
7Cust655220222022
Sheet2
Cell Formulas
RangeFormula
F2:F7F2=MAX(FREQUENCY(IF(B2:E2<>"",COLUMN(B2:E2)),IF(B2:E2="",COLUMN(B2:E2))))
G2:G7G2=INDEX($B$1:$E$1,LOOKUP(2,1/(B2:E2<>""),COLUMN(B:E)-COLUMN(B:B)+1))
H2:H7H2=XLOOKUP(1,--(B2:E2<>""),$B$1:$E$1,,0,-1)
The Index option worked! Thank you so much. 🤗🙏
The version I am running is version 16.64 for Mac.
 
Upvote 0
Another couple of short options below for 'Most Recent', depending on version.

The version I am running is ...
Please record your version in your account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’).

22 09 22.xlsm
BCDEGH
12019202020212022Most RecentMost Recent
2420192019
3720212021
412520212021
52420222022
6454820222022
75520222022
Most Recent
Cell Formulas
RangeFormula
G2:G7G2=LOOKUP(9^9,B2:E2,B$1:E$1)
H2:H7H2=MAXIFS(B$1:E$1,B2:E2,"<>")
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top