Array formula using INDEX, MATCH and INDIRECT fails with #VALUE

BikeJockey

New Member
Joined
Feb 17, 2016
Messages
1
Hi

I have a worksheet that lists all the state changes for an issue along with the date of the state change:
IssueID, OldState, NewState, DateOfChange
111, 1, 3, 05/05/2015
111, 3, 4, 06/05/2015
111, 4, 3, 07/05/2015
112, 1, 3, 08/05/2015
112, 3, 5, 09/05/2015

I want to change this so that it is more like this:

IssueID, DateOfState1, DateOfState2, DateOfState3 .....
111
112

An Issue can go through a single state more than once in which case the latest state counts. Not all issues go through all states

I have sorted the worksheet by IssueID (ASC) and DateOfChange (NEWEST to OLDEST)

Then I have used the following formula in the DateOfState1 column (as an array formula):
=INDEX('Issue'!G:L,MATCH(1,('Issue'!A:A=A2)*('Issue'!C:C=1),0),4)

Being an array formula I selected the column, entered the formula and pressed shift+ctr+enter.

But this only matches to A2 on all rows and what I want is to match on the relevant row so I tried using INDIRECT like so:
=INDEX('Issue'!G:L,MATCH(1,('Issue'!A:A=INDIRECT("A" & ROW()))*('Issue'!C:C=1),0),4)

And then add the formula as an array formula on the column but failed with a #VALUE error.

So I tried this:
=INDEX('Issue'!G:L,MATCH(1,('Issue'!A:A=A2:A6)*('Issue'!C:C=1),0),4)

But that also failed.

Any help in how I do this would be appreciated.

Thanks
 

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.

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

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