Len(), counting?

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,844
Office Version
  1. 365
Platform
  1. Windows
I have the following number and LEN() formula,
As you can see that LEN(), counting 15 for all other and 16 for the last one, while they all 16 characters long.

<form id="form" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'cphMain_btnSearch')" onsubmit="javascript:return WebForm_OnSubmit();" action="./InboundSearch.aspx?PageMode=Invoices" method="post">
</form>
0042017008021337315
0052017008021037315
0072017008021073015
0082017008021073015
0082017008021073215
0092017008021073015
0092017008021073115
0102017008021073016

<tbody>
</tbody><colgroup><col><col></colgroup>


Please advise what I am doing wrong.

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hello Sohail,

You have the numbers formatted to display leading zeroes. The LEN() function only returns the count of real digits in the number.
 
Upvote 0
Thanks,
I am sure I had some other problem, I forgot, it was not that obvious.
 
Upvote 0
The data on the left should be entered as text. Then LEN would work as desired. Well, maybe not: LEN would return 17 for all of them.

However, the 16-character "number" (identifier) is suspicious. Although that is with the range of 16-digit numbers that Excel can represent exactly (<= 2^53), you cannot only type zero as the last digit, because Excel truncates data entry after the 15th digit, replacing any others to the right with zeros.
 
Upvote 0
you cannot only type zero as the last digit, because Excel truncates data entry after the 15th digit, replacing any others to the right with zeros.

Aarrgghh!! That should say "you can only type zero as the last digit".
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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