by Lupp » Fri Jan 18, 2019 3:43 pm
Searching ranges for cells with a specific content (or othertwise meeting a codition) is done using MATCH() basically, but this is restricted to ranges being parts of single columns or of single rows as already mentioned.
This should generally be sufficient, because such a search is made for DATA of a specific kind, and DATA possibly having a value searched for should only occur under the respective data label (field), and thus in ONE column (mostly; exceptionally: a row). If spreadsheets are used for a kind of data keeping they should also regard well proven principles of data keeping.
A two-dimensional search for contents does not occur then. To need it will mostly mean that basic principles were disregarded.
If you are searching a contigency table, on the other hand, you need to realise that a specific content may occur more often than once. Standard MATCH always returns the index of first occurrence. In the 2D-case this concept is ambiguos: Shall the "first" occurrence be the one in the topmost row of any occurrence, or the one in the leftmost column?
In fact I would assume, a solution, if urgently needed, is best done resorting to user code.
Solutions based on standard functions are tricky and therefore error-prone.
You may have a look into the attached example, however. It is showing the principle of ONE of a few thinkable approaches.
You need to understand "array-evaluation" if you want to make use of the example.
- Attachments
-
demoDimensionLine_1.odg
- (13.25 KiB) Downloaded 10 times
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München