return the row number when a match is found

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,141
Office Version
  1. 365
Platform
  1. Windows
Hi all

I am trying to find a value from column C in Columns AC:AE inclusive and if found return the row number of the initial value
for example:
If the value of C2 [DOG] is found in F7 then 2 is returned to A2
Column C will contain unique values

Hope this makes sense - even if the example is pretty pathetic!

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Key[/TD]
[TD]Category[/TD]
[TD]Object[/TD]
[TD]Obj1[/TD]
[TD]Obj2[/TD]
[TD]Obj3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A[/TD]
[TD]CAT[/TD]
[TD]BALL[/TD]
[TD]BAT[/TD]
[TD]MOON[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A[/TD]
[TD]DOG[/TD]
[TD]STARS[/TD]
[TD]KITE[/TD]
[TD]TABLE[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A[/TD]
[TD]MOUSE[/TD]
[TD]KETTLE[/TD]
[TD]COFFEE[/TD]
[TD]VIOLIN[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]B[/TD]
[TD]HAMSTER[/TD]
[TD]DOG[/TD]
[TD]HUTCH[/TD]
[TD]RABBIT[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]B[/TD]
[TD]LION[/TD]
[TD]HERO[/TD]
[TD]MOUSE[/TD]
[TD]JUMPER[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]B[/TD]
[TD]GIRAFFE[/TD]
[TD]CHAIN[/TD]
[TD]GRAB[/TD]
[TD]CAT[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]C[/TD]
[TD]PIG[/TD]
[TD]KEYBOARD[/TD]
[TD]APPLE[/TD]
[TD]DOG[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]C[/TD]
[TD]WORM[/TD]
[TD]APRICOT[/TD]
[TD]CAT[/TD]
[TD]DRUMS[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]D[/TD]
[TD]SQUIRREL[/TD]
[TD]PHONE[/TD]
[TD]CAT[/TD]
[TD]HOUSE[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Your explanation in relation to your visual example makes no sense. Suggest you retry. You talk of searching AC:AE. Your example finds Dog in Column F. Why a two if the row is 7. Very confusing request.
 
Upvote 0
Your explanation in relation to your visual example makes no sense. You talk of searching AC:AE. Your example finds Dog in Column F. Why a two if the row is 7. Very confusing request.

So, In my real sheet I am looking at Columns AC:AE
In my Example this has become Columns D:F [I should have checked that-oops]

So what ever I find in D:F will only ever be found in category A which in my example only has 3 objects
Therefore what I am trying to do is say when you find DOG in D:F locate it in C and return the row number of C in A(n) where n is the Current row number

Therefore in my example the active row is 7 and DOG is found in F7
In Category A DOG is found in Row 2
so in A7 (the row containing DOG in F7) we input the Value 2 because DOG is found in C2

The values in Column C are all unique but the values in Column D, E & F are not
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,532
Messages
6,172,878
Members
452,486
Latest member
standw01

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