Forum Discussion
PeterBartholomew1
Feb 02, 2024Silver Contributor
Working with Binary numbers BASE(..., 2, 7) and bit operations BITXOR, BITAND
I recently came across an Excel challenge from Chinmay Amte on LinkedIn and I plan to post my solution here because it contains some 'off the beaten track' techniques that might be of some interest. ...
Balint79
Jun 17, 2024Brass Contributor
no words, what i have been through, despite thankful 🙂
=LET(
weight;{75\74\43\19\12\5\4};
binary;DEC2BIN(DROP(SEQUENCE(POWER(2;7));-1);7);
factor;MID(binary;SEQUENCE(1;7);1)*1;
votes;BYROW(weight*factor;LAMBDA(r;SUM(r)));
votemin;BYROW(weight*factor;LAMBDA(r;MIN(SUBSTITUTE(r;"0";"99")*1)));
detailed;HSTACK(binary;votes;votemin;(votes>121)*((votes-votemin)<122));
summary;FILTER(detailed;CHOOSECOLS(detailed;4));
header;{"involved"\"votesum"\"kingmaker"\"coalitions"};
divider;{"¤"\"¤"\"¤"\"¤"};
VSTACK(header;SORT(summary;2;1);divider;detailed))