Reverse of INDEX function

jschirra

New Member
Joined
Jan 24, 2018
Messages
10
Is there a function the reverse of INDEX that will match a variable and give its row and column position in a nxm array?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi

Test the target value against each value in the range.

For ex., if your values are in E4:H7 and you want to get the column for the number 3 in that range, use:

=MAX(INDEX(($E$4:$H$7=3)*(COLUMN($E$4:$H$7)-COLUMN($E$4)+1),))

This is just to get you started. You'll have to expand the formula if you want to consider things like duplicate values or not found values.
 
Last edited:
Upvote 0
Hi

Test the target value against each value in the range.

For ex., if your values are in E4:H7 and you want to get the column for the number 3 in that range, use:

=MAX(INDEX(($E$4:$H$7=3)*(COLUMN($E$4:$H$7)-COLUMN($E$4)+1),))

This is just to get you started. You'll have to expand the formula if you want to consider things like duplicate values or not found values.

That works perfectly. Thank you.
 
Upvote 0
PGC01

Can you expand on the 'duplicate values'; I have the 'no match' found covered? I am doing the same type of reverse formula, but it doesn't consider the presence of duplicates on the array sheet.

=IFERROR(INDEX(HWSWSTD[[#Headers],[CURRENT]:[FV N-2]],,MATCH([@[OS Version]],INDEX(HWSWSTD[[#All],[CURRENT]:[FV N-2]],MATCH([@Model],HWSWSTD[[#All],[Model]],0),),0)),"OLDER")

My reverse formula is returning the header title of CURRENT, FV N-1, FV N-2 based on the match of hardware model and software version; duplicates would be in the Model column.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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