Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default return cell address of longest text string in a range

Say I have a range of text strings, A1:A10.

I know I can extract the length of the longest text string in that
range by entering the array formula =MAX(LEN(A1:A10))

How can I return the cell address of the longest string?

Thanks,

Dave

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default return cell address of longest text string in a range

Here are a couple options:

This:
=CELL("address",INDEX(A:A,MATCH(MAX(INDEX(LEN(A1:A 10),0)),INDEX(LEN(A1:A10),0),0)))

or...a shorter way:
="A"&MATCH(MAX(INDEX(LEN(A1:A10),0)),INDEX(LEN(A1: A10),0),0)

Note_1: Because text wrap may impact the display, there are no spaces in
those formulas.

Note_2: If there are multiple entries with the same maximum length, those
formulas return the address of the first.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Dave F" wrote:

Say I have a range of text strings, A1:A10.

I know I can extract the length of the longest text string in that
range by entering the array formula =MAX(LEN(A1:A10))

How can I return the cell address of the longest string?

Thanks,

Dave


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default return cell address of longest text string in a range

Yes this helps. All text string lengths in the range are unique so
note 2 doesn't apply.

Thanks.

On Jul 12, 10:30 am, Ron Coderre
wrote:
Here are a couple options:

This:
=CELL("address",INDEX(A:A,MATCH(MAX(INDEX(LEN(A1:A 10),0)),INDEX(LEN(A1:A10)*,0),0)))

or...a shorter way:
="A"&MATCH(MAX(INDEX(LEN(A1:A10),0)),INDEX(LEN(A1: A10),0),0)

Note_1: Because text wrap may impact the display, there are no spaces in
those formulas.

Note_2: If there are multiple entries with the same maximum length, those
formulas return the address of the first.

Does that help?
***********
Regards,
Ron

XL2002, WinXP



"Dave F" wrote:
Say I have a range of text strings, A1:A10.


I know I can extract the length of the longest text string in that
range by entering the array formula =MAX(LEN(A1:A10))


How can I return the cell address of the longest string?


Thanks,


Dave- Hide quoted text -


- Show quoted text -



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
How to return the address of the range of plotted data on an XY scatter chart? Ken Johnson Charts and Charting in Excel 5 July 4th 06 12:40 PM
Return a formula as text string to a cell Sharon Excel Worksheet Functions 4 April 18th 06 05:40 PM
Longest string in a column Jeff Kantner Excel Worksheet Functions 6 December 1st 05 05:56 AM
Formula to return ADDRESS of cell in range that meets criteria Christie Excel Worksheet Functions 1 March 4th 05 11:13 PM
How to make a cell return the formatted value in a text string (i. n.almeida Excel Worksheet Functions 3 February 2nd 05 01:59 PM


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

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

About Us

"It's about Microsoft Excel"