Lookup function

mib1019

Board Regular
Joined
Nov 9, 2017
Messages
66
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Good morning. I'm looking for some help with what I think would be a lookup function.

Here is a sample of what my two tables look like. In the right table, I need to look up the values in the left table with the rows and columns switched. Is there a formula that would work to do this?

1635776526765.png


Thanks in advance for any help you can give me.

MB
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Using office 365, try entering =TRANSPOSE(Table1[#all]) into a single cell. Change the name of the table to whatever yours is called.
 
Upvote 0
Thanks for your suggestion, but I'll want to maintain a listobject for the transposed cells, which I can't do with the resulting array. I also cannot sort the transposed data by the left column.

Any other ideas?
 
Upvote 0
In that case, it's a simple INDEX and MATCH combination.

I can't see formatting in a screen capture, the dates in the column headers of the green table will definitely be text. If the dates in the other table are also text then use this formula.
Excel Formula:
=INDEX(Table1,MATCH([[#Headers],[31-Oct]],Table1[Date],0),MATCH([@Fruit],Table1[#Headers],0))
or if they are proper dates then you need this one.
Excel Formula:
=INDEX(Table1,MATCH(DATEVALUE([[#Headers],[31-Oct]]),Table1[Date],0),MATCH([@Fruit],Table1[#Headers],0))
 
Upvote 0
Thanks, that worked! Was a little tedious, after copying the formula across the other columns, editing each first row's formula to change the header value[date], but when it's not a big table, it won't be too much trouble.

You rock! Thanks a million.
MB
 
Upvote 0
Was a little tedious, after copying the formula across the other columns, editing each first row's formula to change the header value[date]
I tested the formula by dragging it right and it updated automatically, the reference is relative when the formula only refers to a single column of the headers.

edit:- Now I realise what you meant, Table1[[Date]:[Date]] would make that part absolute.
 
Upvote 0
Solution
So I could have changed it to reference the column instead. Sweet.

Thanks again!
 
Upvote 0
I changed to a non-table address and it copies just perfectly!
You don't need a non-table address for it to work, it works just as well with the table names if you use the format from my reply.

Table1[Date] is relative Table1[[Date]:[Date]] is absolute.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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