Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Leftpad using Rept and Len

Topic Labels: Formulas
217 0
Showing results for 
Search instead for 
Did you mean: 

I’m making course codes (like ACT015) from numbers (like 15) and prefixes like “ACT”. The trick is - how to left pad the numbers with 0 when combining them?

The part of the formula to add the right number of '0’s:
REPT(“0”, 3 - LEN(Number&""))

and the whole formula:
CONCATENATE(Prefix, REPT(“0”, 3 - LEN(Number&"")), Number)

Hope this helps someone! I didn’t see any other posts on the first page of results when I googled “airtable formula leftpad”, so had to get creative.

0 Replies 0