[Solved] Finding position of a match

Discuss the spreadsheet application
Post Reply
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

[Solved] Finding position of a match

Post by CaliRay »

I have a range of cells A10-C2000. All of the A column cells contain names, B column cells contain birth dates and C column cells contain a 7 digit ID number. All I need to do is find a match for a name I enter into cell F10 to verify the name is in the range and return either the cell number where the matching name is or the row containing that name.

An properly structured example formula and how it works would be appreciated. The examples I have read don't explain in detail how this example works. All I get is a 504 error.

Code: Select all

=MATCH($F$10;$A$11:$C2004; 0)-1
Thank you in advance for your help.
Last edited by MrProgrammer on Sun Jul 24, 2022 11:32 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OOo 4.1.3 on Windows 10 Home
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Finding position of a match

Post by Villeroy »

MATCH matches within a vector (one column or row), say column A:

Code: Select all

=MATCH($F$10 ; $A$11:$A$2004 ; 0)-1
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

Re: Finding position of a match

Post by CaliRay »

Thanks for that. What's the correct function for what I need?
OOo 4.1.3 on Windows 10 Home
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Finding position of a match

Post by RusselB »

To the best of my ability to tell, the MATCH function is the function you are looking for.
The reason you were getting that error, is that the MATCH function will only work with 1 row or 1 column.
In your original code you have 3 columns and 1,994 rows. I suspect that you want to keep the number of rows and change the range to be 1 column, as shown in Villeroy's reply.
It will return the matching row number, but if you want the actual cell address, then you're going to have to manually provide the column (and sheet, if necessary) identifier(s).
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Post Reply