Re:Converting Column Number to Letter for Cell Address in Google Sheets

:thinking: What is the problem?

Sadly, i need to use > 26

Welcome to the Make community!

You can use my “Execute JavaScript” module to run a tiny JavaScript function that does this.

Install first: [App] Sam's Toolbox of Useful Modules: @samliew

e.g.:

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":66,"module":"app#sams-toolbox-mls54z:basicjs","version":1,"parameters":{},"mapper":{"code":"// Get input variables\nconst num = input.number;\n\n// Validation, must be a whole integer\nif (isNaN(Number(num)) || Number(num) !== Math.round(Number(num))) {\n  throw new Error(\"Invalid number: \" + num);\n}\n\n// Functions\n// source: https://stackoverflow.com/a/71713806/584192 \nconst _numberToColumn = n => {\n  n = Number(n);\r\n  const res = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[n % 26];\r\n  return n >= 26 ? _numberToColumn(Math.floor(n / 26) - 1) + res : res;\r\n}\n\n// Call function with module input, and store result in variable\nconst col = _numberToColumn(num);\n\n// Module output. Variable names separated by commas\n({ col })","input":[{"key":"number","value":"123"}]},"metadata":{"designer":{"x":1701,"y":10}}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! If you are still having trouble, please provide more details.

— @samliew