Skip to main content
Commonmark migration
Source Link

#Google Sheets, 76 bytes

Google Sheets, 76 bytes

=ArrayFormula(Join(,Text(Code(Mid(A1,Row(Indirect("1:"&Len(A1))),1))-96,"00" 

Sheets will automatically add three closing parentheses when you exit the cell.
Input is in cell A1

Indirect("1:"&Len(A1)) returns a range as tall as the input is long.
Row(Indirect(~)) returns the row numbers, so it's a list of numbers from 1 to the input length.
Mid(A1,Row(~),1) returns each character from the input, one at a time.
Code(Mid(~))-96 returns the ASCII code for each character, down-shifted so a = 1.
Text(Code(~),"00") pads the result above to two digits.
Join(,Text(~)) joins all those padded results without a delimiter.
ArrayFormula(Join(~)) makes all the stuff above operate on arrays. Without, the result would just be the first padded alphabet code: helloworld would return 08.

Example

#Google Sheets, 76 bytes

=ArrayFormula(Join(,Text(Code(Mid(A1,Row(Indirect("1:"&Len(A1))),1))-96,"00" 

Sheets will automatically add three closing parentheses when you exit the cell.
Input is in cell A1

Indirect("1:"&Len(A1)) returns a range as tall as the input is long.
Row(Indirect(~)) returns the row numbers, so it's a list of numbers from 1 to the input length.
Mid(A1,Row(~),1) returns each character from the input, one at a time.
Code(Mid(~))-96 returns the ASCII code for each character, down-shifted so a = 1.
Text(Code(~),"00") pads the result above to two digits.
Join(,Text(~)) joins all those padded results without a delimiter.
ArrayFormula(Join(~)) makes all the stuff above operate on arrays. Without, the result would just be the first padded alphabet code: helloworld would return 08.

Example

Google Sheets, 76 bytes

=ArrayFormula(Join(,Text(Code(Mid(A1,Row(Indirect("1:"&Len(A1))),1))-96,"00" 

Sheets will automatically add three closing parentheses when you exit the cell.
Input is in cell A1

Indirect("1:"&Len(A1)) returns a range as tall as the input is long.
Row(Indirect(~)) returns the row numbers, so it's a list of numbers from 1 to the input length.
Mid(A1,Row(~),1) returns each character from the input, one at a time.
Code(Mid(~))-96 returns the ASCII code for each character, down-shifted so a = 1.
Text(Code(~),"00") pads the result above to two digits.
Join(,Text(~)) joins all those padded results without a delimiter.
ArrayFormula(Join(~)) makes all the stuff above operate on arrays. Without, the result would just be the first padded alphabet code: helloworld would return 08.

Example

Source Link
Engineer Toast
  • 9.6k
  • 1
  • 25
  • 54

#Google Sheets, 76 bytes

=ArrayFormula(Join(,Text(Code(Mid(A1,Row(Indirect("1:"&Len(A1))),1))-96,"00" 

Sheets will automatically add three closing parentheses when you exit the cell.
Input is in cell A1

Indirect("1:"&Len(A1)) returns a range as tall as the input is long.
Row(Indirect(~)) returns the row numbers, so it's a list of numbers from 1 to the input length.
Mid(A1,Row(~),1) returns each character from the input, one at a time.
Code(Mid(~))-96 returns the ASCII code for each character, down-shifted so a = 1.
Text(Code(~),"00") pads the result above to two digits.
Join(,Text(~)) joins all those padded results without a delimiter.
ArrayFormula(Join(~)) makes all the stuff above operate on arrays. Without, the result would just be the first padded alphabet code: helloworld would return 08.

Example