Counting given amount of consecutives

Marvo

Board Regular
Joined
Nov 27, 2023
Messages
155
Office Version
  1. 2021
Platform
  1. Windows
Hi Again, I've constructed a formula

=XLOOKUP("W",K:K,B:B,,0,-1)

That works well, it finds the most recent time there was a "W" in a column.

How could I change that formula so that it would look for a given amount of consecutive "W"s please?

I'm thinking maybe of having it refer to a cell $F$5579 with a number in it, then look for that amount of "W"'s.

So if I put a 3 in the reference cell, the formula would then look for the most recent time there were 3 consecutive "W"'s in column K.

Would that be the way to go?

As always any help appreciated and if there's a better way of achieving the desired result I'm happy to be educated.


/?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
XL2BB isn't in the add-ins lost.
If you are referring to the yellow below, then you have probably not read the green carefully as those first set of steps are only if you already have a previous version installed.

1710883132313.png


If you don't already have a previous version installed, move on to the next solid bullet point.

1710883283341.png
 
Upvote 0
Well I've downloaded and added it to a workbook, followed instructions until it says click on XL2BB in the ribbon but it isn't shown on the ribbon.
 
Upvote 0
I've downloaded and added it to a workbook,
Where does it say to do that?

until it says click on XL2BB in the ribbon but it isn't shown on the ribbon.
Where does it say to do that? Do you mean this instead?
Click on the custom ribbon tab called Xl2bb
..meaning this, which is above the ribbon not in the ribbon

1710893680261.png
 
Upvote 0
I open a new book. I go to the developer tab, click on excel add-ins, X12BB is listed. That's as far as I get, it doesn't show above the ribbon.
 
Upvote 0
So, shown in the image, you can enter any number in Columns C, F, I, O & R and the adjacent box will exhibit the most recent date when that consecutive run was achieved.
As an example I've placed a 5 in C21 and that has returned a date of 6/02/2016 which is the start of the most recent consecutive 5 game run of matches won.
The formula in D21 is =IF(C21="","",XLOOKUP(C21,ALL!$AH$2:$AH$5558,ALL!$B$2:$B$5558,,0,-1))

The formula in AH2 is =IF(K5481="W",1+AH5482,0) copied down.

It all works a treat, I may in future put a hyperlink to D21 so that you can go straight to the result. The only downside? Its doubled the size of the workbook.

I hope this might help someone else in future, I was unable to find a solution o the question anywhere.

Many thanks to all those that took an interest.
 

Attachments

  • Mr Excel.JPG
    Mr Excel.JPG
    46.8 KB · Views: 3
Upvote 0
Solution
Thank you Peter. I was contacted by message by another member at your behest who tried to help, gave me instructions which I followed to the letter, but when I got to the step where you put the add-in file into the XLSTART folder, that folder simply doesn't exist. There was one called STARTUP but that's empty and it wont let you add to it. I was going to report back to the chap but he had closed the chat down and there was no way for me to contact him. All roads I'm afraid lead to a dead end.
 
Upvote 0
Can you show me a picture of what happens when you perform this step from the instructions?

1711091288518.png


Here is my picture

1711091390657.png
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,038
Members
449,092
Latest member
ikke

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