Dynamic INDEX MATCH row & column

CunningFoxDemon

New Member
Joined
Jan 8, 2018
Messages
7
Hello,

I'm trying to identify the last entry in a row using INDEX,MATCH. I'm able to pull the dynamic row, but as I'm unable to have the formula identify the last column in that same row, I am forced to overwrite the data instead of adding a new date's data in a new column.

Can someone help me to correct the below formula to find a dynamic column that finds the last non-blank entry of a dynamic row?

=INDEX('Materials (V)'!$A$2:$FG,MATCH(A3,'Materials (V)'!$A$2:$A,0),2)

Materials (V)!A2 holds the item with the first value entry in B2. In other words "2" in the column variable is finding the first date's data. The 2nd date's data would be in column 3. How do I dynamically call column 3 of that specific row?

Also,
if column 3 doesn't have data in it for the specific row, but the next day it does, say column 4, how do I get it to find that value?

Thank you for your time and support. Any help is much appreciated.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It's difficult to visualize what you're looking for, But i think I get it..

A simple match finds a row #.
You then want to do a match in THAT row #, and index another row based on that match

Right?

Something like this for example

Excel 2013/2016
ABCDEFGHI
1Header1Header2Header3Header4Header5RowValColValHeader4
2otherColVal
3stuff
4hereColVal
5now
6RowValColVal
7not
8thisColVal
9stuff
Sheet1
Cell Formulas
RangeFormula
I1=INDEX(B1:E1,MATCH(H1,INDEX(B2:E9,MATCH(G1,A2:A9,0),0),0))
 
Upvote 0
Sorry, I'll illustrate below:

I want to INDEX MATCH the ItemName2 in the 2nd table with the last row cost entry of the 1st table being D3

ABCD
1MaterialsDate1Date2Date3
2ItemName1201510
3ItemName2200250
4ItemName323

<tbody>
</tbody>

ABCD
1MaterialsQuantityCostTotal
2ItemName15
3ItemName24

<tbody>
</tbody>

Here is what I have so far, but the formula does not dynamically locate the last column entry of the specific row.

=INDEX(Table1!A2:D4,MATCH(A3,Table1!A2:A,0),3)

Currently, the column variable for MATCH is manually entered. I want to make it dynamic to that specific row.

Thank you for the response!
 
Upvote 0
I'm not sure how to edit my own post, but the above formula I posted should be in Table2 cell C3 to pull the cost from Table1 dynamically.
 
Upvote 0
First, this isn't a valid formula, the range is incomplete.
=INDEX(Table1!A2:D4,MATCH(A3,Table1!A2:A??,0),3)
I assume that should be
=INDEX(Table1!A2:D4,MATCH(A3,Table1!A2:A4,0),3)

Currently, the column variable for MATCH is manually entered. I want to make it dynamic to that specific row.
What are you referring to when you say 'the column variable'? The 3 ?
And It's not clear exactly 'how' you imagine that to be made dynamic, based on what?
 
Upvote 0
I should note that I'm using Google Sheets.
The A2:A range is a range that starts at A2 and goes all the way down the A column.

Your assumed formula would also work in this example.

Yes, I'm referring to the 3 as the column variable of the below formula:
=INDEX(Table1!A2:D4,MATCH(A3,Table1!A2:A4,0),3)

I want the INDEX MATCH to pull the row number that matches "ItemNumber2" as well as the last column with a value entered of that same row.
In this example the row is using match to pull the row of "ItemNumber2" from Table1, but it's not pulling the last entered value of that same row dynamically.

When I say dynamic, I mean I want it to pull Table1 D3 just by looking up "ItemNumber2" in Table2 and looking to the row of that row and finding the last entered number.

Thanks again for your time. I apologize if I'm not explanation is not clear. I hope that helps.

 
Upvote 0
OK, I see it now..

Try this
=LOOKUP(9.99999999999999E+307,INDEX($B$2:$D$4,MATCH(A8,$A$2:$A$4,0),0))

I didn't make 2 separate sheets, both tables are on the same page.
A8 is the lookup value.


Excel 2013/2016
ABCD
1MaterialsDate1Date2Date3
2ItemName1201510
3ItemName2200250
4ItemName323
5
6
7MaterialsQuantityCostTotal
8ItemName1510
9ItemName24250
10ItemName33
Sheet1
Cell Formulas
RangeFormula
C8=LOOKUP(9.99999999999999E+307,INDEX($B$2:$D$4,MATCH(A8,$A$2:$A$4,0),0))
C9=LOOKUP(9.99999999999999E+307,INDEX($B$2:$D$4,MATCH(A9,$A$2:$A$4,0),0))
C10=LOOKUP(9.99999999999999E+307,INDEX($B$2:$D$4,MATCH(A10,$A$2:$A$4,0),0))
 
Upvote 0
Hahaha, NOW WAY! That lookup method popped up during my research, but didn't think I would have to put the INDEX function inside of it as the search_range/result_array. That's great!

Thank you so much for the time and support. It means a lot! :)
I'm very excited to finally work with this method of indexing information.

Thank you!!
 
Upvote 0
Would you be wiling to explain how the LOOKUP function, using the biggest calculable number, tells excel to pull the last column with data in it according to the INDEX/MATCH? How does it know to count the columns?
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

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