Lookup value in table, return the cell above

yits05

Board Regular
Joined
Jul 17, 2020
Messages
56
Office Version
  1. 2016
Platform
  1. Windows
Hello,

This is probably simple but I can't seem to figure this out. I would like a formula that looks up the value in A1 to find the match in a table, say d5:J20, and return the cell directly above the matched cell.

Any advice would be appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If you use Index Match, you find the Row using Match then just subtract the number of rows you need to get the row you actually want.
In the case of 1 row before, you might want to include the header row in your range in case what you find is in the first data row.

In the below I have used cell for to get the row, but you could either hard code that or use a match to work out the Column as well.

1616457115511.png


20210323 Index Match offset 1 row.xlsx
ABCDEFGHIJK
130
2
3Return Value
4Column NoCol1Col2Col3Col4Col5Col6Col7
5222010210310410510610710
6332020220320420520620720
730230330430530630730
840240340440540640740
950250350450550650750
1060260360460560660760
11
Workings
Cell Formulas
RangeFormula
B5:B6B5=INDEX($D$4:$J$10, MATCH($A$1,$D$4:$D$10,0)-1,$A5)
 
Upvote 0
If you use Index Match, you find the Row using Match then just subtract the number of rows you need to get the row you actually want.
In the case of 1 row before, you might want to include the header row in your range in case what you find is in the first data row.

In the below I have used cell for to get the row, but you could either hard code that or use a match to work out the Column as well.

View attachment 35044

20210323 Index Match offset 1 row.xlsx
ABCDEFGHIJK
130
2
3Return Value
4Column NoCol1Col2Col3Col4Col5Col6Col7
5222010210310410510610710
6332020220320420520620720
730230330430530630730
840240340440540640740
950250350450550650750
1060260360460560660760
11
Workings
Cell Formulas
RangeFormula
B5:B6B5=INDEX($D$4:$J$10, MATCH($A$1,$D$4:$D$10,0)-1,$A5)
Thank you, Alex.

Just to clarify, however, the lookup value may be in any column in the table. So, for example, as below I would want like a formula that would populate in B2:B4 that search for the values in A2:A4, and returns the cell above. Thanks again

Value to SearchResult:Column1Column2Column3
abcipsumhelloipsumfiller
defworldworldabctext
ghiheredefloremhere
randomwordghi
 
Upvote 0
Are you only looking at a very small number of columns ? If so it would be possible using that concept with IFS.
If its a large number of columns or needs to be scalable, I will have a look but we may need to look to someone else to come up with some suggestions.

Is a helper column acceptable ?
 
Upvote 0
Are you only looking at a very small number of columns ? If so it would be possible using that concept with IFS.
If its a large number of columns or needs to be scalable, I will have a look but we may need to look to someone else to come up with some suggestions.

Is a helper column acceptable ?
Hi, yes, helper column is totally fine. There wont be more than ~6 columns.
 
Upvote 0
Here is one way (assuming values can only occur once in Column1:Column3)

21 03 23.xlsm
ABCDEF
1Value to SearchResult:Column1Column2Column3
2abcipsumhelloipsumfiller
3defworldworldabctext
4ghiheredefloremhere
5randomwordghi
Cell above
Cell Formulas
RangeFormula
B2:B4B2=INDEX(D:F,AGGREGATE(15,6,ROW(D$2:F$5)/(D$2:F$5=A2),1)-1,AGGREGATE(15,6,(COLUMN(D$2:F$5)-COLUMN(D2)+1)/(D$2:F$5=A2),1))
 
Upvote 0

Forum statistics

Threads
1,215,597
Messages
6,125,741
Members
449,256
Latest member
Gavlaar

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