Find row number of a value in a multi column & multirow table

hstaubyn

Board Regular
Joined
Sep 13, 2010
Messages
93
Hi,

I have a table of about 30 columns by 50 rows. Each cell has a unique text value in it. In a separate column to the left of the table, is a list of other text values.

(In case you're interested, this is because each row in the table contains multiple different spellings of the same **** thing, and I am trying to somehow merge them all into one. The trouble is that some of the variations may in time turn out to be significant so I can't just find-replace the lot of them)

I would like to have a formula in a different part of the worksheet that looks at the value of a cell (whose text value will definitely also exist in the 30x50 table) and returns the row number of its counterpart in the table.

With this row number I can use INDIRECT to reference the value in the column running down the left of the table.

It is just like the MATCH function, but needs to work on a 2D table and just return the row number.

Can anyone help? Or is the only way to write a macro to perform the operation?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi,

I have a table of about 30 columns by 50 rows. Each cell has a unique text value in it. In a separate column to the left of the table, is a list of other text values.

(In case you're interested, this is because each row in the table contains multiple different spellings of the same **** thing, and I am trying to somehow merge them all into one. The trouble is that some of the variations may in time turn out to be significant so I can't just find-replace the lot of them)

I would like to have a formula in a different part of the worksheet that looks at the value of a cell (whose text value will definitely also exist in the 30x50 table) and returns the row number of its counterpart in the table.

With this row number I can use INDIRECT to reference the value in the column running down the left of the table.

It is just like the MATCH function, but needs to work on a 2D table and just return the row number.

Can anyone help? Or is the only way to write a macro to perform the operation?
With no repeats in the data...

Control+shift+enter, not just enter:

=IF(COUNTIF(A2:N100,P2),MIN(IF(A2:N100=P2,ROW(A2:A100))),NA())

A2:N100 houses the data and P2 a word of interest. Adjust to suit.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top