Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default =LEN returns incorrect answer


In the following table, the LEN formula returns the incorrect number of
characters.

The first number 34,... is in cell b12, it's corresponding LEN formula to
the right in cell b13.
It is the only one that returns correctly, the rest of the table is
obviously inaccurate.

*** The numbers themselves are based on a "to the nth power" formula.

Does anyone know why this is happening?!?
Thanx......

34,596,000,000 11 =LEN(B12)
124,545,600,000,000 15 =LEN(B13)
448,364,160,000,000,000 18 =LEN(B14)
258,257,756,160,000,000,000 16 =LEN(B15)
12,654,630,051,840,000,000,000 18 =LEN(B16)
34,218,119,660,175,400,000,000,000 20 =LEN(B17)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default =LEN returns incorrect answer

First off, why do you say only the first number returns the correct length?
It looks to me that the first 3 return the correct length. As for the last
3, that does look odd. Just out of curiosity, how are those cells formatted
(and if they are Custom Formatted, show it to us)?

--
Rick (MVP - Excel)


"MikeF" wrote in message
...

In the following table, the LEN formula returns the incorrect number of
characters.

The first number 34,... is in cell b12, it's corresponding LEN formula to
the right in cell b13.
It is the only one that returns correctly, the rest of the table is
obviously inaccurate.

*** The numbers themselves are based on a "to the nth power" formula.

Does anyone know why this is happening?!?
Thanx......

34,596,000,000 11 =LEN(B12)
124,545,600,000,000 15 =LEN(B13)
448,364,160,000,000,000 18 =LEN(B14)
258,257,756,160,000,000,000 16 =LEN(B15)
12,654,630,051,840,000,000,000 18 =LEN(B16)
34,218,119,660,175,400,000,000,000 20 =LEN(B17)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default =LEN returns incorrect answer

Rick,

There is no custom formatting, they're merely "Number", no decimal
places/show thousand separator.

And yes, in this example the first three are correct.

Nonetheless, this is serious [at least for me!].

Is it possible the LEN formula stalls after 18 or 19 characters?

By now, presume someone has copied the table - or built a facsimile - and
rcvd the same results.

Any new thoughts?

Thanx again.
- Mike


"Rick Rothstein" wrote:

First off, why do you say only the first number returns the correct length?
It looks to me that the first 3 return the correct length. As for the last
3, that does look odd. Just out of curiosity, how are those cells formatted
(and if they are Custom Formatted, show it to us)?

--
Rick (MVP - Excel)


"MikeF" wrote in message
...

In the following table, the LEN formula returns the incorrect number of
characters.

The first number 34,... is in cell b12, it's corresponding LEN formula to
the right in cell b13.
It is the only one that returns correctly, the rest of the table is
obviously inaccurate.

*** The numbers themselves are based on a "to the nth power" formula.

Does anyone know why this is happening?!?
Thanx......

34,596,000,000 11 =LEN(B12)
124,545,600,000,000 15 =LEN(B13)
448,364,160,000,000,000 18 =LEN(B14)
258,257,756,160,000,000,000 16 =LEN(B15)
12,654,630,051,840,000,000,000 18 =LEN(B16)
34,218,119,660,175,400,000,000,000 20 =LEN(B17)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default =LEN returns incorrect answer

Okay, I see the problem. The number you are seeing in the cell is not the
value for the cell... it is the number (pared down to 15 significant digits
maximum... all Excel will hold for you) shown to you with a Cell Format of
Number with thousands separator. However, take a look at the value shown in
the Formula Bar for one of those "funny" cells... it is not the number you
type in; rather, it is a number in E-Notation. For example, the cell with
this...

34,218,119,660,175,400,000,000,000

in it actually has a value of this...

3.42181196601754E+25

and *that* value is 20 characters long. This is no different than if you had
typed 123 in a cell with a Custom Format of this...

0"-"0"-"0

the cell would display 1-2-3, but the value in the cell is 123 and if you
used the LEN function on the cell, it would report 3 (the number of digits
in the actual value in the cell).

Back to your original problem.... if you format the cell as Text, or enter
your number with an apostrophe in front of it to make it a text entry, then
the LEN function will return the length you are expecting.

--
Rick (MVP - Excel)


"MikeF" wrote in message
...
Rick,

There is no custom formatting, they're merely "Number", no decimal
places/show thousand separator.

And yes, in this example the first three are correct.

Nonetheless, this is serious [at least for me!].

Is it possible the LEN formula stalls after 18 or 19 characters?

By now, presume someone has copied the table - or built a facsimile - and
rcvd the same results.

Any new thoughts?

Thanx again.
- Mike


"Rick Rothstein" wrote:

First off, why do you say only the first number returns the correct
length?
It looks to me that the first 3 return the correct length. As for the
last
3, that does look odd. Just out of curiosity, how are those cells
formatted
(and if they are Custom Formatted, show it to us)?

--
Rick (MVP - Excel)


"MikeF" wrote in message
...

In the following table, the LEN formula returns the incorrect number of
characters.

The first number 34,... is in cell b12, it's corresponding LEN formula
to
the right in cell b13.
It is the only one that returns correctly, the rest of the table is
obviously inaccurate.

*** The numbers themselves are based on a "to the nth power" formula.

Does anyone know why this is happening?!?
Thanx......

34,596,000,000 11 =LEN(B12)
124,545,600,000,000 15 =LEN(B13)
448,364,160,000,000,000 18 =LEN(B14)
258,257,756,160,000,000,000 16 =LEN(B15)
12,654,630,051,840,000,000,000 18 =LEN(B16)
34,218,119,660,175,400,000,000,000 20 =LEN(B17)




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default =LEN returns incorrect answer

Thanx Rick.

I managed to figure it out.

Not the actual "3.42181196601754E+25 notation", which clarifies the reason
for the problem.

But did change the =LEN(b12) to =LEN(TEXT(b12,0)), which did the trick.

- Mike

"Rick Rothstein" wrote:

Okay, I see the problem. The number you are seeing in the cell is not the
value for the cell... it is the number (pared down to 15 significant digits
maximum... all Excel will hold for you) shown to you with a Cell Format of
Number with thousands separator. However, take a look at the value shown in
the Formula Bar for one of those "funny" cells... it is not the number you
type in; rather, it is a number in E-Notation. For example, the cell with
this...

34,218,119,660,175,400,000,000,000

in it actually has a value of this...

3.42181196601754E+25

and *that* value is 20 characters long. This is no different than if you had
typed 123 in a cell with a Custom Format of this...

0"-"0"-"0

the cell would display 1-2-3, but the value in the cell is 123 and if you
used the LEN function on the cell, it would report 3 (the number of digits
in the actual value in the cell).

Back to your original problem.... if you format the cell as Text, or enter
your number with an apostrophe in front of it to make it a text entry, then
the LEN function will return the length you are expecting.

--
Rick (MVP - Excel)


"MikeF" wrote in message
...
Rick,

There is no custom formatting, they're merely "Number", no decimal
places/show thousand separator.

And yes, in this example the first three are correct.

Nonetheless, this is serious [at least for me!].

Is it possible the LEN formula stalls after 18 or 19 characters?

By now, presume someone has copied the table - or built a facsimile - and
rcvd the same results.

Any new thoughts?

Thanx again.
- Mike


"Rick Rothstein" wrote:

First off, why do you say only the first number returns the correct
length?
It looks to me that the first 3 return the correct length. As for the
last
3, that does look odd. Just out of curiosity, how are those cells
formatted
(and if they are Custom Formatted, show it to us)?

--
Rick (MVP - Excel)


"MikeF" wrote in message
...

In the following table, the LEN formula returns the incorrect number of
characters.

The first number 34,... is in cell b12, it's corresponding LEN formula
to
the right in cell b13.
It is the only one that returns correctly, the rest of the table is
obviously inaccurate.

*** The numbers themselves are based on a "to the nth power" formula.

Does anyone know why this is happening?!?
Thanx......

34,596,000,000 11 =LEN(B12)
124,545,600,000,000 15 =LEN(B13)
448,364,160,000,000,000 18 =LEN(B14)
258,257,756,160,000,000,000 16 =LEN(B15)
12,654,630,051,840,000,000,000 18 =LEN(B16)
34,218,119,660,175,400,000,000,000 20 =LEN(B17)







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoFilter Top 10 - Incorrect Answer Rebecca_SUNY Excel Discussion (Misc queries) 1 November 4th 08 04:55 PM
Pmt formula returns incorrect answer Heinz Excel Discussion (Misc queries) 2 June 6th 08 01:10 AM
Excel 2007- formula =SUM(850*77.1) returns incorrect answer = 1000 Diane Excel Discussion (Misc queries) 5 October 22nd 07 08:43 AM
Formula incorrect answer Wanna Learn Excel Discussion (Misc queries) 3 February 19th 07 04:29 PM
Formula giving incorrect answer... Jambruins Excel Discussion (Misc queries) 3 February 25th 05 06:59 PM


All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"