Hello Everyone, I have policy numbers given to me in a spreadsheet of various lengths. We use 7 digit policy numbers here and I need to convert these feed numbers to 7 digit numbers so that I can further break them down into three columns containing the “first 3”, “second 2” and “last 2” of the 7 digit number.
The best solution that I could imagine was to use this rather long if function to get the 7 digits and then use it to produce my three columns. The function just determines the length of the feed number and appends the appropriate amount of zero’s to the front.
I can’t simply just format the feed column, because that will not allow me to produce the three columns. The function will work, I was just wondering if anyone has a better solution. Regards, Marc
The best solution that I could imagine was to use this rather long if function to get the 7 digits and then use it to produce my three columns. The function just determines the length of the feed number and appends the appropriate amount of zero’s to the front.
Code:
=IF(LEN(A2)=1,"000000"&A2,IF(LEN(A2)=2,"00000"&A2,IF(LEN(A2)=3,"0000"&A2,IF(LEN(A2)=4,"000"&A2,IF(LEN(A2)=5,"00"&A2,IF(LEN(A2)=6,"0"&A2,IF(LEN(A2)=6,"0"&A2,A2)))))))
I can’t simply just format the feed column, because that will not allow me to produce the three columns. The function will work, I was just wondering if anyone has a better solution. Regards, Marc