I need to find a name in an array

MCL_Playz

New Member
Joined
Sep 16, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm setting a up a name system and i need to find a certain persons name within an array. I have a name in B2 formatted as text and then in another sheet I have an array A2:F16 filled with a list of those names. I need to find a column number relative to A. I'm attempting to use Match. this is what I have:
Excel Formula:
=MATCH(B2,Years!A2:F16)
. I'm going to use this in an offset to find the value at the top of that column.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try.
Excel Formula:
=SUMPRODUCT((Sheet2!A2:F10=$B2)*COLUMN(Sheet2!A2:F10))
If heading is there in row 1 and Column header is required.
Excel Formula:
=INDEX(Sheet2!A1:F1,SUMPRODUCT((Sheet6!A2:F10=$B2)*COLUMN(Sheet6!A2:F10)))
 
Upvote 0
Try.
Excel Formula:
=SUMPRODUCT((Sheet2!A2:F10=$B2)*COLUMN(Sheet2!A2:F10))
If heading is there in row 1 and Column header is required.
Excel Formula:
=INDEX(Sheet2!A1:F1,SUMPRODUCT((Sheet6!A2:F10=$B2)*COLUMN(Sheet6!A2:F10)))
Worked perfectly thank you, can you please explain how it works tho
 
Upvote 0
Another option
Excel Formula:
=TOCOL(IF(Years!A2:F16=B2,Years!A1:F1,1/0),2)
 
Upvote 0
In SUMPRODUCT formula 1st part searches for the B2 value in array. Second part Gives the Column number.
Finally It gives the required column Number.
Index Formula selects the value in 1st row corresponding to Column number.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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