Fill Column Value with trailing spaces (or any character) up to a set length

I need to set up some columns for CSV export and they require a specific length that must be filled with blank spaces if the cell content is smaller in length.

On Google Sheets this works very nicely with

=B2&REPT(" ",35-LEN(B2))

On AppSheet this is the only way that I have figured out so far:

SWITCH(LEN[Name],
	1, [Name]&"         ",
	2, [Name]&"        ",
	3, [Name]&"       ",
	4, [Name]&"      ",
	5, [Name]&"     ",
	6, [Name]&"    ",
	7, [Name]&"   ",
	8, [Name]&"  ",
	9, [Name]&" ",
	[Name]
)

Thanks in advanced!

How about using Left().

|



LEFT()



Left-most characters of text

|
| - |

Something like this:

left([Name] & "                                   ", 35)
5 Likes

Yep, that definitely works and is much cleaner than what I had come up with…

Thanks!

1 Like

:clap: :clap: :clap:

1 Like