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.


dickytim

2514 posts

Uber Geek
+1 received by user: 537
Inactive user


#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
Oblivian
7345 posts

Uber Geek
+1 received by user: 2117

ID Verified

  #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



maslink
131 posts

Master Geek
+1 received by user: 41

Subscriber

  #1116068 26-Aug-2014 19:05
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


dickytim

2514 posts

Uber Geek
+1 received by user: 537
Inactive user


  #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

YJ
145 posts

Master Geek
+1 received by user: 9


  #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

garethbezett
39 posts

Geek
+1 received by user: 2


  #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








Geekzone Live »

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



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.