How to find a value based on a COLUMNS criteria

zazybang

New Member
Joined
May 6, 2018
Messages
23
Hey guys, I need a formula that will find a value based on a columns criteria. EX: I am trying to find the opposite of INDEX(x,MATCH(, as it is used for finding values based on a rows criteria.

Sheet 1

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Section: Ab[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name:[/TD]
[TD]----ID:[/TD]
[/TR]
[TR]
[TD]X[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Y[/TD]
[TD]E[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Column C[/TD]
[TD]Column D[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Section: Cd[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name:[/TD]
[TD]----ID:[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]H[/TD]
[TD]K[/TD]
[/TR]
</tbody>[/TABLE]


Sheet 2

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Name[/TD]
[/TR]
[TR]
[TD="align: center"]=FORMULA ID: (J)[/TD]
[/TR]
[TR]
[TD="align: center"]=FORMULA ID: (C)[/TD]
[/TR]
</tbody>[/TABLE]
I am using an Index MATCH formula to get the name in the "=FORMULA" cells, what i require is an extension to this formula that will also write what section the ID came from EX: INDEX(MATCH())&"INSERT FORMULA HERE". So what it should say in Row 3 of sheet 2 is: "G, From Section Cd". While in row 4 it should say: "C, From Section Ab.".



Thanks for any help that is provided!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
From what I can gather, you have the formula to get the name. See if this will help with the Section.

Here is my Sheet1

Excel Workbook
ABCDEFGHIJ
1Section: AbSection: Cd
2Name:----ID:Name:----ID:
3XCGJ
4YEHK
Sheet1



Formula in B2 is copied down.

Excel Workbook
AB
1IDSection
2JSection: Cd
3CSection: Ab
Sheet2
 
Upvote 0
Could you by chance break that formula down?
Look at the example for ID = "J"
(COLUMN(Sheet1!A$1:J$1)-COLUMN(Sheet1!A$1)) produces an array of (column) numbers {0,1,2,3,4,5,6,7,8,9}
Divide by True/False (1/0) depending on whether A3:J4 in Sheet1 are equal to the ID. This produces a lot of #DIV/0! errors except for the one cell that does contain "J". That cell is in the 4th column of the Sheet1 array so it will leave the 4th number (3) in the above array of column numbers.
AGGREGATE(15,6 .... ,1) finds the smallest number in an array, ignoring errors. There is only one number left in the array and that is 3.
Then INDEX retrieves the value from the 3rd cell from the row 1 range in Sheet1 (Section: Cd)
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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