Search code examples
excel-2007

MS Excel 2007 Custom Format


I would like to make a column uniformed by adding a "~" if the number in the field is not ten digits. For example: 123456789~, 2343456~~~, and 543645~~~~.


Solution

  • Your number is in cell A1. The following formula should work. This is not VBA code. Just put it in another cell.

    =A1 & REPT("~", 10-LEN(A1))