Hoping there is a simple-ish formula expression to accomplish this eg, if the input is '26' the output is 'Z' if the input is '52' the output is 'ZZ'
Thanks
Take a look at this macro.
https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Knowledge-Base/Generating-Excel-Column-Letters-in-Alteryx/ta-p/78355/label-name/output
Thanks, I did google and find this but I'm sure this can be done without a batch macro using expressions. Looking for such a solution,
I assume this can be done by dividing the column number by 26 and then referring in some way to the string 'abcdefghijklmnopqrstuvwxyz'
Hey there.
I know this is 4 weeks old but I had the exact same question as you did @Carluccio555
The link that @cjaneczko sent is good, but Alteryx has already changed that page into a Community knowledge post without the attachment. @AlteryxCommunityTeam would you kindly take a look at the link and re-attach the macro?
But for now, @Carluccio555 you can use:
CharFromInt([YourNumber] + 64).
If your first number is 1, adding 64 = 65. CharFromInt converts that into A. 2 gets you B, 3 nets you C, and so on so forth. Now once you hit 26 letters, you’ll need to reset by subtracting 26 and then concatenate the field once more to get AA, AN, AC, etc.
Hope this helps in the interim.
Like so:
You can still download the macros on the attachment.
I see this: https://knowledge.alteryx.com/index/s/article/Generating-Excel-Column-Letters-in-Alteryx-1583460908711
That’s why I was puzzled to your statement. Thanks for finding the original post @cjaneczko !
Very odd. This is what I show when i click on the link in my post.
@Carluccio555, @caltang
Here is another workflow that takes a number and outputs the corresponding Excel Column name associated with it! All without macros:
Small correction to the helpful workflow from @CoG
In the Generate Rows tool: original Loop Expression: Floor((PreModulus)/26,1) corrected Loop Expression: Floor((PreModulus)/26.001,1)
Good catch, @ChrisTX !
Unfortunately, I think the "corrected loop expression" will provide incorrect results for absurdly large values (>26000). That being said, thanks to your insights, I was able to finally see clearly what I struggled for so long to see. I have updated the math so that the outputs match what you and now I have manually verified to be correct. This new workflow should work for every input value you can feasibly throw at it.