# Index and Match ??? Help needed

#### dtwyford

##### New Member
Good day everyone. I could use some guidance. I have table that is used for people to pick dates they want to volunteer their time for. I need to translate the date

from
 Date 1 Date 2 Date 3 Date 4 Date 5 Date 6 Bob x x x Sue x x x John x x x Frank x x x Mary x x x Gail x x x Keith x x x Glenda x x x

<tbody>
</tbody>

to
 Person 1 Person 2 Person 3 Person 4 Date 1 Sue Frank Gail Glenda Date 2 Date 3 Date 4 Date 5 Date 6

<colgroup><col style="width:48pt" width="64" span="5"> </colgroup><tbody>
</tbody>

I am looking for a dynamic formula for the "TO" table. Any thoughts?

D

### Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Copy cell L3 to all other cells in the Range(L3:O8).

Excel 2010
KLMNO
1Person 1Person 2Person 3Person 4
2SueFrankGailGlenda
3Date 1xxxx
4Date 2xx
5Date 3xx
6Date 4x
7Date 5xx
8Date 6x

</tbody>
Sheet1

Worksheet Formulas
CellFormula
L3=IF(INDEX(\$B\$3:\$G\$10,MATCH(L\$2,\$A\$3:\$A\$10,0),MATCH(\$K3,\$B\$2:\$G\$2,0))="x","x","")

</tbody>

<tbody>
</tbody>

Jim,

Thanks, but not quite. The green names are an example of what I want the "TO" table to look like.
The "FROM" Tables top row is the dates, the left most column are the names, the cells under and to the right are the various selections I need to translate / pivot into the "TO" table.
Any tweaks you can recommend?
D

Worksheet Formulas
CellFormula
L3=IF(INDEX(\$B\$3:\$G\$10,MATCH(L\$2,\$A\$3:\$A\$10,0),MATCH(\$K3,\$B\$2:\$G\$2,0))="x","x","")

<tbody>
</tbody>

<tbody>
</tbody>
[/QUOTE]

To accomplish the bringing over of the Names I am unable to do it in using a formula. But I can via VBA.
So here's the (Standard Module) Code.

Rich (BB code):
``````Sub EliminateBlankRowsWhenCopying()
lr = Range("B" & Rows.Count).End(xlUp).Row 'Your from table Date 1 Column
Set Rng = Range("B3:B" & lr)
Application.Calculation = xlCalculationManual
Rng.SpecialCells(xlCellTypeConstants).Offset(0, -1).Copy
Worksheets("Sheet1").Range("L2").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, Transpose:=True
Application.Calculation = xlCalculationAutomatic
End Sub
``````

With a formula

Excel 2013/2016
ABCDEFGHIJKLMN
1Date 1Date 2Date 3Date 4Date 5Date 6Person 1Person 2Person 3Person 4
2BobxxxDate 1SueFrankGailGlenda
3SuexxxDate 2SueFrankMaryKeith
4JohnxxxDate 3BobJohnGailGlenda
5FrankxxxDate 4BobSueMaryKeith
6MaryxxxDate 5JohnFrankKeithGlenda
7GailxxxDate 6BobJohnMaryGail
8Keithxxx
9Glendaxxx
Appendix
Cell Formulas
RangeFormula
K2=IFERROR(INDEX(\$A\$2:\$A\$9,AGGREGATE(15,6,ROW(\$A\$2:\$A\$9)-ROW(\$A\$2)+1/((\$B\$1:\$G\$1=\$J2)*(\$B\$2:\$G\$9="x")),COLUMNS(\$A:A))),"")

Jim ,Thank you.
Darren

To accomplish the bringing over of the Names I am unable to do it in using a formula. But I can via VBA.
So here's the (Standard Module) Code.

Rich (BB code):
``````Sub EliminateBlankRowsWhenCopying()
lr = Range("B" & Rows.Count).End(xlUp).Row 'Your from table Date 1 Column
Set Rng = Range("B3:B" & lr)
Application.Calculation = xlCalculationManual
Rng.SpecialCells(xlCellTypeConstants).Offset(0, -1).Copy
Worksheets("Sheet1").Range("L2").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, Transpose:=True
Application.Calculation = xlCalculationAutomatic
End Sub
``````

'Fluff',
Thank you. I have never used the aggregate function before.
Darren

You're welcome & thanks for the feedback

Replies
1
Views
73
Replies
0
Views
186
Replies
5
Views
148
Replies
0
Views
140
Replies
19
Views
354

1,196,487
Messages
6,015,485
Members
441,898
Latest member
kofafa

### 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.

### Which adblocker are you using?

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

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