Solved

MS Excel

Posted on 2015-02-23
11
66 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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 51

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

Industry Leaders: 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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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