Forum Discussion
Braille Translator Challenge
My original (unedited) no Let, no Lambda solutions:
//Part 1:
=CONCAT(XLOOKUP(BYROW(WRAPROWS(LEN(TOCOL(T5:BS7,,1)),6),CONCAT),BYROW(WRAPROWS(LEN(TOCOL((B4:Q6,B8:Q10,B12:Q14,B16:Q18),,1)),6),CONCAT),TOCOL((B3:Q3,B7:Q7,B11:Q11,B15:Q15),1)))
//Part 2:
=IF(--MID(CONCAT(XLOOKUP(MID(T16,SEQUENCE(LEN(T16)),1),TOCOL((B3:Q3,B7:Q7,B11:Q11,B15:Q15),1),BYROW(WRAPROWS(LEN(TOCOL((B4:Q6,B8:Q10,B12:Q14,B16:Q18),,1)),6),CONCAT))),WRAPCOLS(SEQUENCE(LEN(T16)*6),3),1),B4,"")I took advantage of the fact that TOCOL can accept a non-contiguous range reference, which it processes by area. The 3x2 Braille blocks are converted to 6-digit binary codes, which are used to perform the character lookup. In part 2, the lookup is reversed, whereby each character in the phrase is replaced with its corresponding 6-digit code, then MID is used with a sequence array to extract the individual binary digits and produce the 2D array.
My attempt at generalizing it (somewhat); plus, an alternative approach for part 2:
//Part 1:
=BRA2TXT(T5:BS7, TOCOL((B3:Q3,B7:Q7,B11:Q11,B15:Q15),1), BRA2BIN((B4:Q6,B8:Q10,B12:Q14,B16:Q18)))
//Part 2:
=BRA2TXT(T16, TOCOL((B3:Q3,B7:Q7,B11:Q11,B15:Q15),1), BRA2BIN((B4:Q6,B8:Q10,B12:Q14,B16:Q18)), 1)
//Where:
BRA2BIN = LAMBDA(ref,
BYROW(WRAPROWS(LEN(TOCOL(ref, , 1)), 6), CONCAT)
);
BRA2TXT = LAMBDA(phrase,chr_array,bin_array,[text_to_braille],
IF(
text_to_braille,
IF(--MID(XLOOKUP(MID(phrase, NUM3x2(phrase, 1), 1), chr_array, bin_array), NUM3x2(phrase), 1), "●", ""),
CONCAT(XLOOKUP(BRA2BIN(phrase), bin_array, chr_array))
)
);
NUM3x2 = LAMBDA(txt,[opt],
TRANSPOSE(1 + IF(opt, QUOTIENT, MOD)(SEQUENCE(LEN(txt) * 2, 3, 0), 6))
);In part 2 of this version, the text phrase is exploded in a Kronecker product fashion, whereby every character is extracted 6 times each, which in turn lookup their corresponding 6-digit codes in a 3x2 block. MID is then lifted over the resulting array, extracting just a single binary digit from each code.
OK this is why I love this forum. I still need to dive into all these solutions more because I learn SO MUCH from all of you. But right off the back I can say I just learned:
a) TOCOL can take inputs like that
b) you can pass FUNCTIONS using an IF statement (i.e. on LINE 24: IF(opt, QUOTIENT, MOD)(SEQUENCE(LEN(txt) * 2, 3, 0), 6)
I will continue to review and I'm sure I will continue to learn. Thank you all.
- djclementsAug 13, 2026Silver Contributor
As it so happens, I also picked up both of these little nuggets from other contributors somewhere along the way. Community forums such as this are a wonderful way to share and learn from each other. <3
Cheers!