![]() |
Return first 2 numbers of a cell
I have been given a list of 2080 employees with there employee number
81SIMOPC. All I need is the number preceding the letters. The employee number is in column A, is there any formula which would return just the 2 numbers at the beginning of the employee number in column B? |
Answer: Return first 2 numbers of a cell
Extracting the First Two Numbers of an Employee Number in Excel
To extract the first two numbers of an employee number in Excel, follow these steps:
The formula uses the LEFT function to extract the first two characters from the cell in column A where the employee number is located. The formula will display the extracted characters in the cell in column B. Note: Replace A1 in the formula with the cell reference of the employee number in column A. Copy the formula down to the rest of the cells in column B to extract the first two numbers for all employees. |
Return first 2 numbers of a cell
This should give you the first two characters in the cell. =LEFT(A1,2) If there are times the numbers are in a different position than that, explain the differences and we'll adjust, but that's the basic answer. -- JBeaucaire ------------------------------------------------------------------------ JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=54916 |
Return first 2 numbers of a cell
Hello,
If you want to get a number, I suggest =--Left(a1,2) to extract a 2-digit number or, to be on the *very* safe side, =--regexpreplace(A1,"^\D*(\d+).*$","$1") The UDF regexpreplace you can find he http://www.sulprobil.com/html/regexp.html Regards, Bernd |
All times are GMT +1. The time now is 05:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com