ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Adding area codes only to phone numbers missing an area code (https://www.excelbanter.com/excel-discussion-misc-queries/176443-adding-area-codes-only-phone-numbers-missing-area-code.html)

RC

Adding area codes only to phone numbers missing an area code
 
I'm trying to clean up some data that contains phone numbers that were
exported out of a employee database and imported into an Excel file. Each
employee's data makes up one row of data in the Excel file, and the phone
numbers of all employees are in cells in one column. The phone numbers for
some employees have the area code while the area code is missing in the phone
numbers for the other employees. Is there some method, other than manually
editing each cell containing a phone number that's missing the area code,
that I can use to add the area code to only those employee phone numbers that
are missing the area code?
--
Thanks,
RC

ExcelBanter AI

Answer: Adding area codes only to phone numbers missing an area code
 
Hi RC,

Yes, there is a way to add area codes to phone numbers that are missing them in Excel. Here's how you can do it:
  1. Insert a new column next to the column containing the phone numbers.
  2. In the first cell of the new column, enter the area code you want to add.
  3. Select the entire column containing the phone numbers (including the header).
  4. Click on "Home" tab in the ribbon, then click on "Find & Select" and select "Replace" from the dropdown menu.
  5. In the "Find what" field, enter a single space (press the spacebar once).
  6. In the "Replace with" field, enter a space followed by the area code you entered in step 2 (e.g. " 123").
  7. Click on "Replace All" to replace all spaces with the area code in the selected column.
  8. You should now have all phone numbers with the area code added, but some may have two area codes. To fix this, select the entire column again and repeat steps 4-7, but this time search for two spaces and replace with a single space followed by the area code.

That's it! You should now have all phone numbers with the area code added, without having to manually edit each cell. Let me know if you have any questions or if there's anything else I can help you with.

Best regards,
[Your Name]


ExcelBanter AI

Answer: Adding area codes only to phone numbers missing an area code
 
Hi RC,

Yes, there is a way to add area codes to phone numbers that are missing them in Excel. Here's how you can do it:
  1. Insert a new column next to the column containing the phone numbers.
  2. In the first cell of the new column, enter the area code you want to add.
  3. Select the entire column containing the phone numbers (including the header).
  4. Click on the "Home" tab in the Excel ribbon.
  5. Click on "Find & Select" in the "Editing" section of the ribbon.
  6. Click on "Replace" in the drop-down menu.
  7. In the "Find what" field, enter a single space (press the spacebar once).
  8. In the "Replace with" field, enter a space followed by the area code you entered in step 2 (e.g. " 555").
  9. Click on "Replace All".

This will add the area code to all phone numbers that were missing it. If there were any phone numbers that already had the area code, they will not be affected.

Jim Thomlinson

Adding area codes only to phone numbers missing an area code
 
Is your data text or numbers??? If it is text exactly what does it look like???
--
HTH...

Jim Thomlinson


"RC" wrote:

I'm trying to clean up some data that contains phone numbers that were
exported out of a employee database and imported into an Excel file. Each
employee's data makes up one row of data in the Excel file, and the phone
numbers of all employees are in cells in one column. The phone numbers for
some employees have the area code while the area code is missing in the phone
numbers for the other employees. Is there some method, other than manually
editing each cell containing a phone number that's missing the area code,
that I can use to add the area code to only those employee phone numbers that
are missing the area code?
--
Thanks,
RC


Gord Dibben

Adding area codes only to phone numbers missing an area code
 
Assuming area code is the same for each employee.

=IF(LEN(A1)=8,"229-"&A1,A1)


Gord Dibben MS Excel MVP

On Tue, 12 Feb 2008 11:37:01 -0800, RC wrote:

Thanks, Jim, it's text with the dashes, and look like the following:
229-123-4567



RC

Adding area codes only to phone numbers missing an area code
 
Thanks Gord, the formula did the job!
--
Thanks again,
RC


"Gord Dibben" wrote:

Assuming area code is the same for each employee.

=IF(LEN(A1)=8,"229-"&A1,A1)


Gord Dibben MS Excel MVP

On Tue, 12 Feb 2008 11:37:01 -0800, RC wrote:

Thanks, Jim, it's text with the dashes, and look like the following:
229-123-4567





All times are GMT +1. The time now is 12:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com