LEN vs Characteristic count

R2ah1ze1l

Board Regular
Joined
Nov 10, 2017
Messages
93
I have a file that holds some data, I wanted to keep the characteristics in specified cells to less then a length of 18 characters total.
I tried using the round function, then the trunc function. When I use the len function it returns a value of 13. All things should be good right?
I seem to be getting an error on a sample of lines where it appears there is still greater than 18 characters. Does trunc only reduce the value on the surface?

FYI I performed the trunc function in an adjacent column, copied that data and re-pasted it in the original cells as 'values only'.
Any ideas are appreciated!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
What exactly does your data look like?
Can you post some samples?

Note that for numbers, Excel can only retain 15 significant digits.
 
Upvote 0
Original data: -109.29237088101
Current data: -109.29237088

Example of spreadsheet view (measurement field visually reduced to 3 decimals)
Removed
300.03​
INSP CMM C
442​
1​
-109.300​
200581EAEF2425CMM0710-1434
Removed
300.03​
INSP CMM C
443​
1​
-109.295​
200581EAEF2426CMM0710-1434
Removed
300.03​
INSP CMM C
444​
1​
-109.298​
200581EAEF2427CMM0710-1434
Removed
300.03​
INSP CMM C
445​
1​
-109.308​
200581EAEF2428CMM0710-1434
Removed
300.03​
INSP CMM C
446​
1​
-109.307​
200581EAEF2429CMM0710-1434
Removed
300.03​
INSP CMM C
447​
1​
-109.297​
200581EAEF2430CMM0710-1434
Removed
300.03​
INSP CMM C
448​
1​
-109.294​
200581EAEF2431CMM0710-1434
Removed
300.03​
INSP CMM C
449​
1​
-109.313​
200581EAEF2432CMM0710-1434
Removed
300.03​
INSP CMM C
450​
1​
-109.300​
200581EAEF2433CMM0710-1434
Removed
300.03​
INSP CMM C
451​
1​
-109.299​
200581EAEF2434CMM0710-1434
Removed
300.03​
INSP CMM C
452​
1​
-109.300​
200581EAEF2435CMM0710-1434
Removed
300.03​
INSP CMM C
453​
1​
-109.309​
200581eaef2436CMM0710-1434
Removed
300.03​
INSP CMM C
454​
1​
-109.292​
200581eaef2437This is the example aboveCMM0710-1434
Removed
300.03​
INSP CMM C
455​
1​
-109.302​
200581EAEF2438CMM0710-1434
Removed
300.03​
INSP CMM C
456​
1​
-109.296​
200581EAEF2439CMM0710-1434
Removed
300.03​
INSP CMM C
457​
1​
-109.291​
200581EAEF2440CMM0710-1434
Removed
300.03​
INSP CMM C
458​
1​
-109.298​
200581EAEF2441CMM0710-1434
Removed
300.03​
INSP CMM C
459​
1​
-109.295​
200581EAEF2455CMM0710-1434
Removed
300.03​
INSP CMM C
460​
1​
-109.299​
200581EAEF2456CMM0710-1434
Removed
300.03​
INSP CMM C
461​
1​
-109.292​
200581EAEF2457CMM0710-1434
Removed
300.03​
INSP CMM C
462​
1​
-109.301​
200581EAEF2458CMM0710-1434
 
Upvote 0
Your image did not come out.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

If you want to limit it to 18 characters, you could do something like this:
Excel Formula:
=LEFT(A1,18)+0

Note that you may also need to change the format of the cell, and change the number of decimal places to see the entire entry.
 
Upvote 0
Your image did not come out.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

If you want to limit it to 18 characters, you could do something like this:
Excel Formula:
=LEFT(A1,18)+0

Note that you may also need to change the format of the cell, and change the number of decimal places to see the entire entry.
I thought wrapping the table with [c0de][/c0de] was the right way, I already had corrected that.
I cannot DL the XL2BB.

I will attempt the code sample you suggested.
Thank you
 
Upvote 0
I thought wrapping the table with [c0de][/c0de] was the right way, I already had corrected that.
No, the Code tags are used for posting VBA code, not table data.

Note that there is also an "Upload Image" button at the bottom of the editor.
While not as good as using XL2BB (which allows us to copy and paste into Excel), it can post images of what your data looks like.
 
Upvote 0
The code suggestion of =LEFT(A1,18)+0 turns the values to text.
Still failed and I used 13 instead of 18.
I will wait for the helpdesk of the software.

I appreciate your efforts.
 
Upvote 0
The code suggestion of =LEFT(A1,18)+0 turns the values to text.
The LEFT function returns a Text value, but adding 0 to it should coerce it back to a number.
If it doesn't, then there is something else in your entry that is not allowing it to be converted to a number (some character other and a number, decimal point, or negative sign).

I tried it on the example you gave, and it worked for me.
Can you provide an example that doesn't work, including:
- The actual data you are applying it to
- Your expected result
- The result you are getting
 
Upvote 0
The LEFT function returns a Text value, but adding 0 to it should coerce it back to a number.
If it doesn't, then there is something else in your entry that is not allowing it to be converted to a number (some character other and a number, decimal point, or negative sign).

I tried it on the example you gave, and it worked for me.
Can you provide an example that doesn't work, including:
- The actual data you are applying it to
- Your expected result
- The result you are getting
I had forgotten the "+0"
after retrying it now is a numeric value as you stated it should.

Still getting the exceeds 18 character limit when I am using 13 as my value.

You would most likely need access to the location I am uploading to, and I can't grant you that. Thanks again for your efforts!
 
Upvote 0
Still getting the exceeds 18 character limit when I am using 13 as my value.
Can you walk me through an actual example?
What is the value?
How/where are you trying to impose this limit?
Are you running this on existing data, or new data entry?
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

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