Brian Dunning's FileMaker Custom Functions

DecToAlpha ( decimal )

Returns the representation of a decimal number as a variable-length alphabetic text string.

  Average rating: 4.2 (45 votes) Log in to vote

Michael Horak   Michael Horak - Show more from this author
*COMMENT Visual Realisation

Share on Facebook Share on Twitter

  Sample input:
0
1
2

25
26
27

51
52
53

701
702
703

18277
18278
18279

etc.
  Sample output:
A
B
C

Z
AA
AB

AZ
BA
BB

ZZ
AAA
AAB

ZZZ
AAAA
AAAB

etc.

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns the representation of a decimal (base-10) number as a variable-length alphabetic text string, similar to the column headings in Excel: A, B, C ... Z, AA, AB ... AZ, BA, BB ... ZZ, AAA, AAB ... ZZZ, AAAA, AAAB, etc.

NOTE:
DecToAlpha expects numbers to start at 0 (zero). In other words, DecToAlpha (0) returns "A", while DecToAlpha (1) returns "B". If your numbers start at 1, and you want the number 1 to be represented as "A", use DecToAlpha (decimal - 1).

 

Comments

Alex Mead   Alex Mead
Oct 27, 2020
I'm trying to figure out how to reverse this process to ultimately create an increment script. Idea is that I turn a, alpha field (A,B,C...AA,AB...ZZ) into a decimal, then +1, then turn back into an alpha.

Has anyone come across this or found a solution?
Many thanks!
 
Michael Horak   Michael Horak, *COMMENT Visual Realisation
Oct 27, 2020
Post your question on one of the forums (e.g. https://fmforums.com/).
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: