table_array split into two sets of cells

BigBillTolbert

New Member
Joined
Oct 19, 2022
Messages
4
Office Version
  1. 365
Platform
  1. MacOS
I am doing a simple VLOOKUP and it works fine:

Screen Shot 2022-10-19 at 1.34.34 PM.png


I want to do the same lookup, however the table_array is split into two sets of cells.

Screen Shot 2022-10-19 at 1.35.51 PM.png


I tried to use =VLOOKUP(A5,A8:B9 C10:D11,2) setting it to A8:B9 and C10:D11 and got an error. I'm not sure if you can have a table_array that is split up like I am showing or if I just have bad syntax.

I know I can move the rows around or create some formulas to make it look like one contagious set of data, but I am trying to read the source of the data as it comes to me.

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You could try
Excel Formula:
=XLOOKUP(A5,A8:A9,B8:B9,XLOOKUP(A5,C10:C11,D10:D11))
but it would be better to get the data sorted out.
 
Upvote 0
You could try
Excel Formula:
=XLOOKUP(A5,A8:A9,B8:B9,XLOOKUP(A5,C10:C11,D10:D11))
but it would be better to get the data sorted out.
Thanks for the reply. The data is clean as there will only be one match within both datasets. I did look at your approach and was able to make it work and then the issue moved to what if I have 12 data sets like one for each month.

I thought I could do something within the table_array argument specifically I might be able to keep it to one formula vs 12 formulas that are netted out to get the one formula that has the right piece of data.
 
Upvote 0
the issue moved to what if I have 12 data sets like one for each month.
That is why I said it would be better to get the data sorted out. ;)
Do you have the Hstack function yet?
 
Upvote 0
I am doing a simple VLOOKUP and it works fine:

View attachment 76569

I want to do the same lookup, however the table_array is split into two sets of cells.

View attachment 76570

I tried to use =VLOOKUP(A5,A8:B9 C10:D11,2) setting it to A8:B9 and C10:D11 and got an error. I'm not sure if you can have a table_array that is split up like I am showing or if I just have bad syntax.

I know I can move the rows around or create some formulas to make it look like one contagious set of data, but I am trying to read the source of the data as it comes to me.

Thanks

The correct answer is to use the VSTACK() function.

=VLOOKUP(A5,VSTACK(A8:B9,C10:D11),2)
 
Upvote 0
Glad you sorted it & thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,215,781
Messages
6,126,863
Members
449,345
Latest member
CharlieDP

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