match an array with a criteria then outputs row number of ma

edy

New Member
Joined
Oct 31, 2002
Messages
3
hi,
i'm trying to search for matches on an array (a1:a4)with b1 then B2 and so on as the criteria. Then display the row number as an output (column c)as shown

a b c
1 6 7 2
2 7 8 3
3 8 6 1
4 9 12 7
5 10
6 11
7 12
i have try this statement
if (countif ($a$1:$a$7,b1),row()
it just won't dislay the right row number of the match. all the entries for A and b are unique.

thanks
This message was edited by edy on 2002-11-01 00:37
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
On 2002-11-01 00:36, edy wrote:
hi,
i'm trying to search for matches on an array (a1:a4)with b1 then B2 and so on as the criteria. Then display the row number as an output (column c)as shown

a b c
1 6 7 2
2 7 8 3
3 8 6 1
4 9 12 7
5 10
6 11
7 12
i have try this statement
if (countif ($a$1:$a$7,b1),row()
it just won't dislay the right row number of the match. all the entries for A and b are unique.

thanks
This message was edited by edy on 2002-11-01 00:37
Hi edy and welcome to the board.

You can use simple MATCH here which will do exactly what you need:

=MATCH(B1,$A$1:$A$7)

Copy to other rows.

Eli
 
Upvote 0
Hi edy:

Welcome to the Board!

You can use the following formula in cell C1 and then copy down:

=MATCH(B1,$A$1:$A$7,0)

or you can use the following array formula:

{=MATCH(B1:B4,$A$1:$A$7,0)}

Regards!
Yogi Anand
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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