[Solved] Which cell has the most characters? formula?

Discuss the spreadsheet application
Post Reply
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

[Solved] Which cell has the most characters? formula?

Post by dawidek990 »

Hello, I have a question, I have 5 columns, and in each row of the column there is a given name as in the attachment.
What to do that in column G, or some other one next, fomula showed me which cell has the most characters, or most character ">" and showed or indexed it?
So something like: indicate which cell has the most characters, or character ">" and show it.
Attachments
kategorie chwilowy.ods
(14.04 KiB) Downloaded 71 times
Last edited by Hagar Delest on Thu Feb 20, 2020 12:20 am, edited 1 time in total.
Reason: tagged solved
OpenOffice 4.1.6 Windows 10
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Which cell has the most characters? formula?

Post by Lupp »

There is a fundamental problem with your question: The ONE cell "with the most characters" will simply not exist if there are more than one cells containing the same maximum number of characters.
Acceptably simple means (formulas based on standard functions) will only return the first cell containing the maximum found. There may be more to the right (if matched in a row) or to the bottom (if matched in a column).
If more complexity is accepted, you still need to consider that a cell only can return ONE result. Returning more than one match in a cell would require to create something like a list in text form. AOO does not provide a standard function for this purpose.
Also see attachment. Errors and the "second-match-issue" are marked there by coloring.
Attachments
aoo101140findCellOfMaxTextlengthAndSo_1.ods
(19.57 KiB) Downloaded 67 times
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Re: Which cell has the most characters? formula?

Post by dawidek990 »

ok, is fine, formula can show me first finded row.
But now how i can index it? formuła show me d4 but i need cell content.
OpenOffice 4.1.6 Windows 10
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Which cell has the most characters? formula?

Post by keme »

dawidek990 wrote:... how i can index it? ...
Use the INDEX() function
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Which cell has the most characters? formula?

Post by Zizi64 »

formuła show me d4 but i need cell content.
Try the function INDIRECT().
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Which cell has the most characters? formula?

Post by Lupp »

Omitting the ADDRESS() function and instead passing the MATCH() result to the INDEX() function as the column index should be rather efficient.
I only used ADDRESS() in the preliminary solution to ease the comparison with what the OQer already had entered by hand.
Attachments
aoo101140findCellOfMaxTextlengthAndSo_2.ods
(19.87 KiB) Downloaded 61 times
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
dawidek990
Posts: 55
Joined: Thu Dec 13, 2018 10:27 am

Re: Which cell has the most characters? formula?

Post by dawidek990 »

INDIRECT() is the best and most simple function ;]
is working, thank you very much ;]
OpenOffice 4.1.6 Windows 10
Post Reply