INDEX/MATCH Query - Amendment needed

Kirstym1918

New Member
Joined
Dec 17, 2017
Messages
45
Hi all,

I have this formula below which INDEXs a list for every date of the year vertically G4:G369, I then created a match for the column next to the date so if the cell has a H, it returns the date from the INDEX range...BUT it keeps returning the same duplicated date over and over when I drag the formula down in to the next cell 38 cells I am using. I know this is what INDEX/MATCH will do but how to I get the formula to move on to the next match if the cell above has already retrieved it?

=INDEX($G$4:$G$369,MATCH($J$1,$H$4:$H$369,0))

Many Thanks
 
It works for me


Excel 2013/2016
GHIJ
3H
401/01/2019W02/01/2019
502/01/2019h04/01/2019
603/01/2019w07/01/2019
704/01/2019h08/01/2019
805/01/2019w09/01/2019
906/01/2019w11/01/2019
1007/01/2019h12/01/2019
1108/01/2019h
1209/01/2019h
1310/01/2019w
1411/01/2019h
1512/01/2019h
1613/01/2019w
Sheet1
Cell Formulas
RangeFormula
J4=INDEX($G$4:$G$34,AGGREGATE(15,6,(ROW($G$4:$G$34)-ROW($G$4)+1)/($H$4:$H$34=$H$3),ROWS($A$1:$A1)))


Is this how your data looks?
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
It works for me

Excel 2013/2016
GHIJ
3H
401/01/2019W02/01/2019
502/01/2019h04/01/2019
603/01/2019w07/01/2019
704/01/2019h08/01/2019
805/01/2019w09/01/2019
906/01/2019w11/01/2019
1007/01/2019h12/01/2019
1108/01/2019h
1209/01/2019h
1310/01/2019w
1411/01/2019h
1512/01/2019h
1613/01/2019w

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
J4=INDEX($G$4:$G$34,AGGREGATE(15,6,(ROW($G$4:$G$34)-ROW($G$4)+1)/($H$4:$H$34=$H$3),ROWS($A$1:$A1)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Is this how your data looks?

Yes pretty much, I'm probably just being a numpty, what data should A1 refer to at the end of the formula?
 
Upvote 0
It isn't referring to anything, it's basically a count, so in J4 it returns1, J5 returns 2 etc.

AGGREGATE(15,6,...,ROWS($A$1:$A1)))
is basically the same as the small function, so the ROWS section on the end is saying the 1st smallest, 2nd smallest etc
 
Upvote 0
It isn't referring to anything, it's basically a count, so in J4 it returns1, J5 returns 2 etc.

AGGREGATE(15,6,...,ROWS($A$1:$A1)))
is basically the same as the small function, so the ROWS section on the end is saying the 1st smallest, 2nd smallest etc


Its now working, helped that I could look how you worked it out.

Thank you very much Fluff :)
 
Upvote 0
Glad you sorted it & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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