Forum Discussion
Working with Binary numbers BASE(..., 2, 7) and bit operations BITXOR, BITAND
"but for 127 possibilities it's more than up to the task
(for much more than 127 perhaps Python is the best option)"
I wouldn't give up on the Excel formula language that easily. BASE is good for numbers up to 2^53! Mind you, I had never noticed that DEC2BIN has a 'places' parameter, so I could have used it.
I first saw it when lori_m used it for a Chandoo minimum length formula challenge. My recollection is that it was a case of multiplying by 37 in base 36 to double up the letter encoding a value.
Peter - you have a better memory than me, it was only after ten minutes of searching I found this (Code Golf) formula for checking if a string contains a repeated character:
=COUNT(SEARCH(BASE(({0,1,2,3,4,5}+{0;1;2;3;4;5}*6)*37,36,2),A1))>0
I remember avoiding the dreaded CSE entry and unnecessary range dependencies introduced by ROW, etc. were an integral part of such challenges. Things are much more straightforward these days - Excel formulas being a bone fide language and all - though maybe not quite as fun 🙂
( https://dhexcel1.wordpress.com/2017/10/03/boolean-formula-for-repetitive-characters-in-a-string/ )
- PeterBartholomew1Feb 06, 2024Silver ContributorI don't know whether to be more impressed by your original answer or by the fact that you can still find it!
BTW I have corrected a critical typo in my post.