averageUsername123
averageUsername123

Reputation: 723

Google Sheets - Return X rows based on cell value

Let's say I have a list of names:

enter image description here

And I have another list for how many rows of each name I want to see:

enter image description here

How do I create a formula that outputs the following (notice how I want to take the first X of each first + last name grouping):

Here is the link to the Google sheets if you'd like to write it out: https://docs.google.com/spreadsheets/d/16hBmQmC3IKyJwnPpx_xCf1WXlATEGbJpKwo8nlcB5So/edit#gid=0

Upvotes: 1

Views: 226

Answers (1)

rockinfreakshow
rockinfreakshow

Reputation: 29904

Added solution to your tab here

=QUERY(MAP(A2:A,B2:B,C2:C,INDEX(XLOOKUP(B2:B&C2:C,E:E&F:F,G:G,)),LAMBDA(ax,bx,cx,dx,IF(ax="",,IF(ax<=dx,{ax,bx,cx},)))),"Select * Where Col2!=''")

-

enter image description here

Upvotes: 3

Related Questions