Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeff Kantner
 
Posts: n/a
Default Longest string in a column

Hi,
I'm looking for the function combination to determine, in a column of text,
what is the maximum number of characters in any one cell. max(len(cell))
works for any one cell, but max(len(A:A)) manufactures a number from
somewhere but whatever it is, it's not the number of characters in the
longest cell. Perhaps an array function? But my attempt at that ended with
#NUM!.

Thx.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Longest string in a column

You actually have the right idea:
=MAX(LEN(A1:A10))

Commit that array formula by holding down the [Ctrl]+[Shift] when you press
[Enter]


Does that help?

***********
Regards,
Ron


"Jeff Kantner" wrote:

Hi,
I'm looking for the function combination to determine, in a column of text,
what is the maximum number of characters in any one cell. max(len(cell))
works for any one cell, but max(len(A:A)) manufactures a number from
somewhere but whatever it is, it's not the number of characters in the
longest cell. Perhaps an array function? But my attempt at that ended with
#NUM!.

Thx.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeff Kantner
 
Posts: n/a
Default Longest string in a column

Thanks v much. I guess the limitation is the reference has to be an
enumerated row range, not just A:A, e.g. I don't necessarily know the number
of rows in the column, but since I'm looking for MAX, an arbitrarily long
(high) number works, the empty cells at the bottom are < MAX so don't affect
the result.

"Ron Coderre" wrote:

You actually have the right idea:
=MAX(LEN(A1:A10))

Commit that array formula by holding down the [Ctrl]+[Shift] when you press
[Enter]


Does that help?

***********
Regards,
Ron


"Jeff Kantner" wrote:

Hi,
I'm looking for the function combination to determine, in a column of text,
what is the maximum number of characters in any one cell. max(len(cell))
works for any one cell, but max(len(A:A)) manufactures a number from
somewhere but whatever it is, it's not the number of characters in the
longest cell. Perhaps an array function? But my attempt at that ended with
#NUM!.

Thx.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Longest string in a column

Hi!

One way:

Array entered using the key combo of CTRL,SHIFT,ENTER:

=MAX(LEN(A1:A10))

Biff

"Jeff Kantner" wrote in message
...
Hi,
I'm looking for the function combination to determine, in a column of
text,
what is the maximum number of characters in any one cell. max(len(cell))
works for any one cell, but max(len(A:A)) manufactures a number from
somewhere but whatever it is, it's not the number of characters in the
longest cell. Perhaps an array function? But my attempt at that ended with
#NUM!.

Thx.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Longest string in a column

On Wed, 30 Nov 2005 15:08:01 -0800, Jeff Kantner
wrote:

Hi,
I'm looking for the function combination to determine, in a column of text,
what is the maximum number of characters in any one cell. max(len(cell))
works for any one cell, but max(len(A:A)) manufactures a number from
somewhere but whatever it is, it's not the number of characters in the
longest cell. Perhaps an array function? But my attempt at that ended with
#NUM!.

Thx.


Yes you do need an array function. However, you cannot refer to an entire
column in an array function.

So the array-entered formula =MAX(LEN(A1:A65535)) should work.


--ron


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Myles
 
Posts: n/a
Default Longest string in a column


Supposing we have the following in a1:a5

ColA
------
CocaCola
Alfafa
Oats
Strawberry
Wheat

How cam we adapt the array formula to deliver the *longest text*?
Intuitively, I tried *{=INDEX(A1:A8,MAX(LEN(A1:A10)),1)} *but to no
avail.


--
Myles
------------------------------------------------------------------------
Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=489634

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Longest string in a column

Hi!

Try this:

Array entered:

=INDEX(A1:A5,MATCH(MAX(LEN(A1:A5)),LEN(A1:A5),0))

Biff

"Myles" wrote in
message ...

Supposing we have the following in a1:a5

ColA
------
CocaCola
Alfafa
Oats
Strawberry
Wheat

How cam we adapt the array formula to deliver the *longest text*?
Intuitively, I tried *{=INDEX(A1:A8,MAX(LEN(A1:A10)),1)} *but to no
avail.


--
Myles
------------------------------------------------------------------------
Myles's Profile:
http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=489634



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
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Arithmetical Mode of Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 4 July 14th 05 09:15 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
How can I sort an entire spreadsheet from a list prod sorter Excel Worksheet Functions 4 November 17th 04 03:43 AM


All times are GMT +1. The time now is 09:01 PM.

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"