Vlookup into an array that has multiple instances of the lookup value

PleaseHelp2

New Member
Joined
Jul 1, 2011
Messages
2
Please Help!!

I am trying to do a vlookup into an array that has multiple instances of the value that I am looking up.

The value that I am looking up is an input variable (based on a list), so the number of times the value appears in the array will vary based on the input variable.

I want to return the data for all instances on seperate lines.

I've done a countif to determine the number of times the value is in the array. For example, the countif returned 3 so I know that there are 3 instances of this this input variable in the array, therefore I want to return 3 new values on 3 lines.
[=COUNTIF('Sheet1'!B7:B51,A7)]

I've done a match to determine where the 1st instance of the value is. For example, match returned 34, so for this input variable, I know the data starts on row 34 of the array.
(I've sorted the array that I'm looking up into to ensure that it is sorted so I know that I want to pull rows 34, 35, and 36)
[=MATCH(A7,'Sheet1'!B7:B51,0)]

The countif and match are looking at the same sheet.

So essentially I want my vlookup for the first line to be B34:E51, for the next line to be B35:E51 and the third line, B36:E51.

Is there a way to populate the cells based on the information I have?
Should I be approaching this differently? I'm trying to do it with a complex formula, but should I be writing a macro?

Any thoughts or ideas are appreciated!

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

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