Vlookup returning data then move on to next criteria

goletagwt

New Member
Joined
Feb 25, 2020
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello all! Hope everyone is safe and well. I am trying to pull data from a part of a worksheet based on criteria from a list that has varying numbers of results for each criteria. Sample data is posted below and what I want to get is everything for criteria 1 and then when formula runs out of data for that criteria moves on to next criteria in the list and continues.

24619 this value has two rows in the data​
246194723084
246194723085
24313 this value has three rows in the data​
243134722886
243134722887
243134723143
What I want to return is
24619 4723084
24619 4723085
24313 4722886
24313 4722887
24313 4723143
There is a lot of data for this. Just trying to make a formula work on vary amounts of each criteria. Hope this makes sense. Formula I am currently trying to tweak is

{=IF(ISERROR(INDEX($N$1:$O$273,SMALL(IF($N$1:$N$273=$B4,ROW($N$1:$N$273)),ROW(1:1)),2)),"",INDEX($N$1:$O$273,SMALL(IF($N$1:$N$273=$B4,ROW($N$1:$N$273)),ROW(1:1)),2))}

This will pull everything for 24619 if I copy formula down but I want to copy down until 24619 doesn't return anything and then have the formula go to next criteria in the column 24313 and pull all of that data.

Thank for any feedback.

goletagwt
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,215,043
Messages
6,122,822
Members
449,096
Latest member
Erald

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