Solved

MS Excel

Posted on 2015-02-23
11
64 Views
Last Modified: 2015-02-24
I create a workbook with data imported from Access. One of the fields has 13 digits in it that are in the text data type. I wish to put a - after the first five, then after the next five, followed by the last three. I have tried an input mask,  and it will not work with text. So I am thinking an Array formula might work, but I have no idea how to create it. This way I can create a template for the end user - so the 13 digits will import like this 12345-67890-123. Can anyone help with this? I have tried everything. Wheen I create the input mask in the Access query it shows up properly - but on import it shows up without the dashes.

Please help

Thank you
0
Comment
Question by:dawber39
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40627063
use something like this in the query as one of the column

select Left([FieldName], 5) & "-" & Mid([Fieldname],6,5) & "-" & Right([FieldName],3) As whatever
from tableName
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40627070
Try this formula

Concatinate(mid(a1,1,5),"-",mid(a1,6,5),"-",mid(a1,11,3))

I,m using my mobile and sorry for any typing mistakes. The idea is using concatinate and mid functions
0
 

Author Comment

by:dawber39
ID: 40627362
Rey - Ive done something like that prior -  but it still imports to excel as the whole thing without dashses - thats why it needs to be on the excel end. If it were a number field  - it would be easy... but thaank you for the suggestion. Far west - I will try that tomorrow
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40627374
<Rey - Ive done something like that prior -  but it still imports to excel as the whole thing without dashses ->
 impossible, maybe you have not done it properly..
how are you importing to excel?
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40627588
In your query, use this expression for the offending value:

TroubleField: Format([YourPlainNumberField], "\'@@@@@\-@@@@@\-@@@")

It prefixes a single quote which forces Excel to read it as text.

/gustav
0
 

Author Comment

by:dawber39
ID: 40628472
I will try the other suggestions - The Concatenation formula does not work

Attached is a spreadsheet with the original item number - and the way I want the dashes to show in Excel

Thank you for your input people
Dash-Test.xlsx
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40628483
here is the excel file with formula
0
 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 40628486
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40628501
where is your access db?
0
 

Author Closing Comment

by:dawber39
ID: 40628591
Awesome - thank you for all your input - but this formula works. You people are awesome up here.
0
 

Author Comment

by:dawber39
ID: 40629745
I will be posting anothe question with regards to this - there seems to be another issue that was not taken into account. The formula works in a field that is not imported. The query that separates the field in 3 sections with dashes - runs perfectly in Access - but the import loses that format - but we'll leave that for another question.

Thanks again guys
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question