Hi - I am trying to transform some employee id data. The employee id values are text (alpha-numeric). Generally speaking, FTE’s have a six digit number. Contractors have a number preceded by the letters CON. There are occasional exceptions to this rule of thumb. See the table in my sample data spreadsheet.
What I am trying to do is transform the values which are highlighted in yellow in column A of my attached spreadsheet to the values highlighted in green, and leave all other values untouched.
Here’s the challenge: Some FTE employee id’s are less than 100000, and in this case they show up as a value with less than six digits. I am pretty sure I can use the text.padstart function to convert, for example, a four digit employee id such as 4212 to 004212. I think I can create an if then else statement that will measure the length of the employee id value and then I can determine how many zeros to prepend.
However, here’s where an exception comes into play. We have an employee id that is four alpha characters. I don’t want to prepend any zeros to this particular value. I have tried to find a function that checks to see if the first character in a string is numeric or not, which I think I could use to then ignore that row and move on to the next row, but I haven’t been able to find a function to do this, and I’m not sure how I can take existing functions to accomplish the same thing.
Any suggestions on how to accomplish this will be much appreciated.
Thanks!
Trey