Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




2515 posts

Uber Geek
+1 received by user: 541
Inactive user


Topic # 151455 26-Aug-2014 08:35
Send private message

Hi All,

Not sure if this is the right place to post this, and appologies if I am incorerect.

I have some data I need to format from an excel sheet to upload.

The data is pulled from another system and can have some very basic manipulation before being uploaded.

What I need to do is format phone numbers, they come out of one system as 2 cells, first is area code, the second the number.

i.e. First field 04 second field 1234567 I have used the & function to add them together in another field but it removes the leading zero everytime, I have tried different formats for the destination cell but nothing is working! If I change to text then it returns the text "=F2&F3"

Create new topic
2902 posts

Uber Geek
+1 received by user: 312


  Reply # 1115649 26-Aug-2014 08:51
Send private message

The source columns need to be the same type as the destination. IE all need to be 'text'

I just did it and it works fine, the only reason I can see that you would get the equation as text is inputting that incorrectly, or not utilising the insert function builder window

The alternate is use concantinate function

113 posts

Master Geek
+1 received by user: 28

Subscriber

  Reply # 1116068 26-Aug-2014 19:05
2 people support this post
Send private message

It sounds like the numbers are stored as text given that the leading zero is displayed in the first column, but maybe not, this formula should work regardless of whether column A is stored as text or number.

Assuming you are using columns A and B for the two numbers, try:

=CONCATENATE(TEXT(VALUE(A1),00)," ",TEXT(VALUE(B1),0000000))

This should yield a text formatted cell, with phone numbers in the style 0X YYYYYYY


 
 
 
 




2515 posts

Uber Geek
+1 received by user: 541
Inactive user


  Reply # 1116208 27-Aug-2014 08:02
Send private message

Thanks for that formula, excuse my ignorance but when I use the formula it removes the extra zeros in the formula.

How do I get Excel to stop doing this!

It returns a #value! error.

YJ

102 posts

Master Geek
+1 received by user: 4


  Reply # 1116211 27-Aug-2014 08:09
Send private message

dickytim: Thanks for that formula, excuse my ignorance but when I use the formula it removes the extra zeros in the formula.

How do I get Excel to stop doing this!

It returns a #value! error.


=CONCATENATE(TEXT(A1,00)," ",TEXT(B1,0000000))

this should do the job

31 posts

Geek


  Reply # 1116215 27-Aug-2014 08:23
Send private message

I used to have this issue with part numbers with leading zeroes.  Only reliable method I founds was to ensure that the source file was .txt, not .csv.  Excel would automatically open CSVs and convert strings containing only digits to their numeric value therefore stripping the leading zeroes from the text.  TXTs would use the text import wizard.  As others have noted, one of the steps in the wizard allows you to set the data type for each column.  The column with leading zeroes needs to be set to text, not general.

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Geekzone Live »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.