Auto Format of Data Entry

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,592
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a column of cells that the data takes on the same format...

N### ## ##

I just want to be able to quickly type in the 7 numbers (ie 1234567), and when I exit that cell it takes on the format N123 45 67.

How do I go about doing that?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I have a column of cells that the data takes on the same format...

N### ## ##

I just want to be able to quickly type in the 7 numbers (ie 1234567), and when I exit that cell it takes on the format N123 45 67.

How do I go about doing that?
Will your number ever have leading zeros?
 
Upvote 0
Yes .. they could have leading zeros.

I've tried this custom format ....

"N"### ## ##

but it doesn't work if the first number is 0.
 
Upvote 0
Awesome!!! Exactly what was needed. Thank you!
 
Upvote 0
Hi folks,

OK ... now, I need to take this one step further. Although now these cells are formatted properly to provide the visual needs, they are not providing the data I need to extract from them in left, right, mid formulae.

For example. By entering 0591904 in cell a2, the resulting cell shows N059 19 04

I now need to break it down ... b2=left(a2,4) with expected results "N059"; right(a2,2) with expected results "04"

But b2's result is 5919, not N059 ...

I see what it's doing ... it's taking the first 4 characters of the data entered, not the displayed value.

What do I need to do to extract from the displayed data?
 
Upvote 0
Hi folks,

OK ... now, I need to take this one step further. Although now these cells are formatted properly to provide the visual needs, they are not providing the data I need to extract from them in left, right, mid formulae.

For example. By entering 0591904 in cell a2, the resulting cell shows N059 19 04

I now need to break it down ... b2=left(a2,4) with expected results "N059"; right(a2,2) with expected results "04"

But b2's result is 5919, not N059 ...

I see what it's doing ... it's taking the first 4 characters of the data entered, not the displayed value.

What do I need to do to extract from the displayed data?
For the left characters try one of these...

=LEFT(TEXT(A1,"""N""000 00 00"),4)

If ALL the entries are formatted to start with the letter N then this may be a bit simpler (less cryptic):

="N"&LEFT(TEXT(A1,"000 00 00"),3)
 
Upvote 0
Haha ... outstanding. Working wonderfully.
OK ... I know I said I needed to only go one more step further. But maybe I lied ... I have ONE additional function I'd like to do ....

Here is my formula:

Code:
=CONCATENATE($B292," ",$C292," ",LEFT(TEXT($G292,"""N""000 00 00"),4),".",MID(TEXT($G292,"""N""000 00 00"),6,2),".",RIGHT(TEXT($G292,"""N""000 00 00"),2),".000"," ",LEFT(TEXT($H292,"""W""000 00 00"),4),".",MID(TEXT($H292,"""W""000 00 00"),6,2),".",RIGHT(TEXT($H292,"""W""000 00 00"),2),".000","   ;",$D292,", ",$E292)

I'd like to add some colour to the result ...

ZFN 392 N064.54.24.000 W125.33.54.000 ;Tulita, NT
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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