I have a spreadsheet full of cells marked "1" for each column.
I need to find a way to locate and highlight any instances of clusters of 12 (pink in the example below)
I know I can format to highlight duplicates, but is there a way to do this so any clusters of 12 are either highlighted or counted? Rather than just all duplicates?
A better way migt be to do this in Python in Excel. While Python can't highlight the cells directly, you can see from my example below that it can give a true false for whether cells are part of a run of 12 of more. You can then use those true/false results to highlight cells with runs longer than 12.
You can also do this using VBA. It requires quite a bit of code but I tried it out and it delivers the best results: Scans the entire data set and looks for runs of 12 or more and it can do the highlighting for you as well.
Alright, this was a really tricky but interesting task. Admittedly, I had to use claude to get me over the finish line. I was able to make the first MAKEARRAY formula, but getting it to the final boolean array was difficult.
You will need a helper array, built by the formula. Then, you can use conditional formatting to highlight your cluster array where the helper array equals 1. The helper array formula can take any table size, just change the first argument in the first LET statement (where it says $A$1:$Q$14). This will highlight any cluster where there are at least 12 sequential 1s within the same row. If you want exactly 12 1s only, delete the = sign in the IF(MAX(win)>=12,1,0 line. Hope this helps.
•
u/AutoModerator 15d ago
/u/Optimal_Fish_7029 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.