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!

Solved Solved
0 3 191
1 ACCEPTED SOLUTION

How about using Left().

 

appsheet_rebrand_logo.pngLEFT()

Left-most characters of text

Something like this:

left([Name] & "                                   ", 35)

View solution in original post

3 REPLIES 3

How about using Left().

 

appsheet_rebrand_logo.pngLEFT()

Left-most characters of text

Something like this:

left([Name] & "                                   ", 35)

👏👏👏

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

Thanks!

Top Labels in this Space