Home > Net >  Vlookup code for a query in Google Sheets
Vlookup code for a query in Google Sheets

Time:01-06

I have 2 different tabs in a sheet and I want to fetch minimum "Age" along with "Father Name" of the given two duplicate names of children. You can check left tab as what data look like and right tab for what result I want, In right tab No name will occur twice and I have to fetch only the age with minimum number with VLookup or any other function.

Check This Image for Details

I tried Vlookup, with min function but I was not getting desired result.

CodePudding user response:

Try the following formula-

=LAMBDA(nm,ag,{nm,ag,MAP(nm,ag,LAMBDA(p,q,FILTER(C:C,A:A=p,D:D=q)))})(UNIQUE(A2:A8),BYROW(UNIQUE(A2:A8),LAMBDA(x,MINIFS(D2:D,A2:A,x))))

enter image description here

CodePudding user response:

you can try:

=INDEX(IFNA(VLOOKUP(A3:A,SORT('TAB1'!A:D,4,1),{4,3},)))
  • Change TAB1 in the formula to your respective tab name

enter image description here

  • Related