Help with Index/Match formula.

jmazorra

Well-known Member
Joined
Mar 19, 2011
Messages
707
Hello:

I am using the following formula on my report:

Code:
=INDEX('Open Leave Report'!$P:$P,MATCH(D2,'Open Leave Report'!$C:$C,0))

Works well, unless I have the reference sheet has multiple rows with the same look up value ie:

Code:
Column C                                                   Column P
[TABLE="width: 361"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]
DVX46J6K[/TD]
[TD][/TD]
[TD="align: right"]6/1/2018[/TD]
[/TR]
[TR]
[TD]DVX46J6K[/TD]
[TD]Y[/TD]
[TD="align: right"]6/29/2018[/TD]
[/TR]
[TR]
[TD]DVX46J6K[/TD]
[TD]Y[/TD]
[TD="align: right"]8/24/2018[/TD]
[/TR]
</tbody>[/TABLE]

So when I look up the data on the return sheet it looks like this

Code:
[TABLE="width: 361"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]DVX46J6K[/TD]
[TD][/TD]
[TD="align: right"]6/1/2018[/TD]
[/TR]
[TR]
[TD]DVX46J6K[/TD]
[TD][/TD]
[TD="align: right"]6/1/2018[/TD]
[/TR]
[TR]
[TD]DVX46J6K[/TD]
[TD][/TD]
[TD="align: right"]6/1/2018[/TD]
[/TR]
</tbody>[/TABLE]

How can I modify my Index/Match formula to return the values exactly as my reference table?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

wideboydixon

Well-known Member
Joined
Jun 2, 2016
Messages
3,401
You'll need an array formula and SMALL ...

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">DVX46J6K</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">6/1/2018</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">DVX46J6K</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">6/29/2018</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">DVX46J6K</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">8/24/2018</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">G2</th><td style="text-align:left">{=INDEX(<font color="Blue">'Open Leave Report'!$P:$P,SMALL(<font color="Red">IF(<font color="Green">'Open Leave Report'!$C:$C=D2,ROW(<font color="Purple">'Open Leave Report'!$C:$C</font>)</font>),COUNTIF(<font color="Green">D$2:D2,D2</font>)</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />

WBD
 

Forum statistics

Threads
1,136,339
Messages
5,675,195
Members
419,553
Latest member
hanahass

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
Top