Forum Discussion
ZainAziz
Nov 25, 2020Copper Contributor
Incomplete Excel Cells to be filled with specific characters while writing ID number
Hi! Hopefully everyone of this community is well and good. I'm facing an issue that I need to write an ID Card number from data given in cells in rows. The situation is this that, if the input cel...
Riny_van_Eekelen
Nov 26, 2020Platinum Contributor
ZainAziz Perhaps like this?
In B2 and copied down:
=IFERROR(CHOOSE(5-LEN(A2),A2&9,A2&99,A2&999,A2&9999),A2&"")+0
It will deduct the number of characters for the input from 5 and chooses to attach 1, 2, 3 or 4 9s to the input value. In the above example, I added "+0" in the end to force Excel to make numbers of the end result. If these can remain texts, just leave out that part.