How to integrate VLOOKUP with MAX function?

rajamdade

New Member
Joined
Jun 14, 2014
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone,

Kindly let me know how to integrate the VLOOKUP function with MAX in order to format data of Table 1 for the given query ids as in Table 2. Moreover, I would appreciate it if you could help with the formula to populate the Max identity value in the neighboring cell:

MS Office Version: 2016
Provided data: Table 1.


QueryIdentification% identity
28097.m000052MAP kinase 980.658
28097.m000052MAP kinase 1679.254
28752.m000329MAP kinase 1181.481
28752.m000329MAP kinase 477.746
29625.m000700MAP kinase 1838.944
29625.m000700MAP kinase homolog 238.762
29625.m000700MAP kinase 1938.523

Required output format: Table 2.

QueryExact IdentificationMAX % identity
28097.m000052MAP kinase 980.658
28752.m000329MAP kinase 1179.254
29625.m000700MAP kinase 1838.944
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Vlookup is not the correct function for the task. With a newer version of Excel, you could use MAXIFS. With your version, the best you will get will be something like
Book1 (version 1).xlsb
ABC
1QueryIdentification% identity
228097.m000052MAP kinase 980.658
328097.m000052MAP kinase 1679.254
428752.m000329MAP kinase 1181.481
528752.m000329MAP kinase 477.746
629625.m000700MAP kinase 1838.944
729625.m000700MAP kinase homolog 238.762
829625.m000700MAP kinase 1938.523
9
10
11QueryExact IdentificationMAX % identity
1228097.m000052MAP kinase 980.658
1328752.m000329MAP kinase 1181.481
1429625.m000700MAP kinase 1838.944
Sheet11
Cell Formulas
RangeFormula
C12:C14C12=AGGREGATE(14,6,$C$2:$C$8/($A$2:$A$8=A12)/($B$2:$B$8=B12),1)
 
Upvote 0
Vlookup is not the correct function for the task. With a newer version of Excel, you could use MAXIFS. With your version, the best you will get will be something like
Book1 (version 1).xlsb
ABC
1QueryIdentification% identity
228097.m000052MAP kinase 980.658
328097.m000052MAP kinase 1679.254
428752.m000329MAP kinase 1181.481
528752.m000329MAP kinase 477.746
629625.m000700MAP kinase 1838.944
729625.m000700MAP kinase homolog 238.762
829625.m000700MAP kinase 1938.523
9
10
11QueryExact IdentificationMAX % identity
1228097.m000052MAP kinase 980.658
1328752.m000329MAP kinase 1181.481
1429625.m000700MAP kinase 1838.944
Sheet11
Cell Formulas
RangeFormula
C12:C14C12=AGGREGATE(14,6,$C$2:$C$8/($A$2:$A$8=A12)/($B$2:$B$8=B12),1)
Thanks, @jasonb75 I actually missed something in my question, I also wanted to return the value of "Identification" in table 1 to the "Exact identification" of table 2 having a max identity as in column C.

Thanks again...
 
Upvote 0
Is this what you mean?

Book1 (version 1).xlsb
ABC
1QueryIdentification% identity
228097.m000052MAP kinase 980.658
328097.m000052MAP kinase 1679.254
428752.m000329MAP kinase 1181.481
528752.m000329MAP kinase 477.746
629625.m000700MAP kinase 1838.944
729625.m000700MAP kinase homolog 238.762
829625.m000700MAP kinase 1938.523
9
10
11QueryExact IdentificationMAX % identity
1228097.m000052MAP kinase 980.658
1328752.m000329MAP kinase 1181.481
1429625.m000700MAP kinase 1838.944
Sheet11
Cell Formulas
RangeFormula
B12:B14B12=INDEX($B$2:$B$8,MATCH(2,1/($A$2:$A$8=A12)/($C$2:$C$8=C12)))
C12:C14C12=AGGREGATE(14,6,$C$2:$C$8/($A$2:$A$8=A12),1)
 
Upvote 0
Is this what you mean?

Book1 (version 1).xlsb
ABC
1QueryIdentification% identity
228097.m000052MAP kinase 980.658
328097.m000052MAP kinase 1679.254
428752.m000329MAP kinase 1181.481
528752.m000329MAP kinase 477.746
629625.m000700MAP kinase 1838.944
729625.m000700MAP kinase homolog 238.762
829625.m000700MAP kinase 1938.523
9
10
11QueryExact IdentificationMAX % identity
1228097.m000052MAP kinase 980.658
1328752.m000329MAP kinase 1181.481
1429625.m000700MAP kinase 1838.944
Sheet11
Cell Formulas
RangeFormula
B12:B14B12=INDEX($B$2:$B$8,MATCH(2,1/($A$2:$A$8=A12)/($C$2:$C$8=C12)))
C12:C14C12=AGGREGATE(14,6,$C$2:$C$8/($A$2:$A$8=A12),1)
Thanks, @jasonb75 but I am getting the following error in the "exact identification" column...

Ricinus_MAPKs Domain-Motif Scan.xlsx
ABC
1QueryIdentification % identity
228097.m000052MAP kinase 980.658
328097.m000052MAP kinase 1679.254
428752.m000329MAP kinase 1181.481
528752.m000329MAP kinase 477.746
629625.m000700MAP kinase 1838.944
729625.m000700MAP kinase homolog 238.762
829625.m000700MAP kinase 1938.523
9
10
11QueryExact IdentificationMAX % identity
1228097.m000052#VALUE!80.658
1328752.m00032981.481
1429625.m00070038.944
Sheet5
Cell Formulas
RangeFormula
B12B12=INDEX($B$2:$B$8,MATCH(2,1/($A$2:$A$8=A12)/($C$2:$C$8=C12)))
C12:C14C12=AGGREGATE(14,6,$C$2:$C$8/($A$2:$A$8=A12),1)
 
Upvote 0
Try array confirming the formula, select B12, then press F2, Shift +Ctrl + Enter.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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