Formatting Text

tycasey17

Board Regular
Joined
Sep 26, 2013
Messages
93
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I am trying to have a number that is consistent with a 1111-22-333-4444 format to have a shortened version of 22-333-4444. At times, it will have a letter in the string or it the "22" section will start with a 0. I have used the two formats going through the FORMAT CELLS > NUMBER > CUSTOM > 00-000-0000 or ##-###-#### and I have used the formulas of =TEXT(RIGHT(A1,9),"00-000-0000") and/or =TEXT(RIGHT(A1,9),"##-###-####"). I need the number to be properly displayed for use in other tabs.

Is there a way to have the number regardless if it starts with a 0 or has a letter of some sort?


Example:
Original Input: 1234-1C-234-5678
=TEXT(RIGHT(A1,9),"00-000-0000") displays 1C2345678

Original Input: 1234-01-234-5678
=TEXT(RIGHT(A1,9),"##-###-####") displays 1-234-5678
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
try this
Excel Formula:
=RIGHT(TEXT(A1,0000-00-000-00000),11)
 
Upvote 0
Solution
Maybe
=MID(A1,6,11)

Never mind. I thought you were trying to return only a portion of a string, but you're trying to apply a format. But I do get the desired results??

1111-22-333-444422-333-4444
1234-1C-234-56781C-234-5678
Weird that in Excel, MID requires a value for number of characters to be taken. Access does not require this, and if not provided, takes everything after the start point by default.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,244
Members
448,879
Latest member
VanGirl

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