adding zero at the start of number

vipulgos

Active Member
Joined
Aug 17, 2002
Messages
335
Office Version
  1. 2010
Platform
  1. Windows
Dear all,
I have phone numbers imported from outlook in csv format. Now these numbers are like 2782512512, i want to add Zero at the start of this number. So, it will become 02782512512. How can i do this. Find and Replace method doesn't work.
please guide me.
 
Last edited:
Does this return the desired result in all cases?

Q2, copied down:

=TEXT(K2,REPT(0,INDEX({4,10},MATCH(LEN(A2),{0,9}))))
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi Vipul,

Just enter the below formula in the adjacent columns i.e if Phone numbers are in Column A, enter the formula in Column B. You will get the phone numbers in the format you want.

=IF(LEFT(A2,1)="0",A2,"0"&A2)
 
Upvote 0
All the formula sent are no doubt good, but what happen next is the real problem. After getting all the data edited, this workbook is to be save in csv format. At this time saving in csv format, all the editing will be lost. The data will once more looks like 2782512222 in place of 02782512222. I wonder why other members haven't face the same problem?
 
Upvote 0
Members please come forward, I want to transfer outlook data to my new phone. It's really urgent.
 
Upvote 0
As long as you make sure your numbers are formatted as text, the leading zeroes should be preserved. I just tested this myself. Formatted some cells text, and added leading zeros to some numbers. Then saved the woorksheet as .csv file.
Open the file in Notepad, and you will see the zeros are still there. If you try to open the .csv file in Excel all will be converted back to numbers and the zeroes will dissapear. So I don't think the problem is in saving the .csv file. The problem is in the reopening/import you do in Outlook or wherever you try to open the file. I have not tried to import to Outlook, so I don't know if there are any option for specifying that numbers should be imported as text.
 
Upvote 0
As long as you make sure your numbers are formatted as text, the leading zeroes should be preserved. I just tested this myself. Formatted some cells text, and added leading zeros to some numbers. Then saved the woorksheet as .csv file.
Open the file in Notepad, and you will see the zeros are still there. If you try to open the .csv file in Excel all will be converted back to numbers and the zeroes will dissapear. So I don't think the problem is in saving the .csv file. The problem is in the reopening/import you do in Outlook or wherever you try to open the file. I have not tried to import to Outlook, so I don't know if there are any option for specifying that numbers should be imported as text.
please try to save the file after formating numbers to text starts from zero.When you save the same file with csv, it will re-formated as number without zero in front. I request you to please try to import the data in outlook, you will realise the problem.
 
Upvote 0
I just tried importing a .csv file to outlook contacts. The zeroes in front of phone number came thru, no problem.

Did you try to open your .csv file in Notepad ? You need to tell me if the zeros are missing there or not. Then we can figure out if the problem is in Excel or in Outlook.

If the zeroes are not in the .csv when you open it with Notepad, the problem is in Excel. If so, make sure you select all your cells. Format as text, and make sure you see the zeroes. Then it should be exported correct.
 
Upvote 0
Dear all,
I found the solution,
1) export data in Microsoft Excel ( not as csv)
2) go to edit>findalll>278
3) select all the cells in find dialog box, then come to excel sheet, don't left click anywhere, just right click in the sheet>the apply format as TEXT. then replace all with 0278.
Then save it close it.
Don't try to change any field name, etc.
Then import this back to outlook. If any field removed or edited, it will give Translation error....ODBC error, etc., on import choose the default mapping.
This will solve the problem.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top