Vlookup and MAX not working.

gedkins

New Member
Joined
Sep 30, 2014
Messages
15
Hi,

I am working with a pivot table and attempting to extract the highest value (count) found and returning a user name based on that. I am getting the dreaded N/A as a result of my formula. I am running Excel 2010. Here is the test case I have.


AB
Bob1
Fred2
Bill3
Sam4

<tbody>
</tbody>








in a cell elsewhere on the sheet I have the following formula: =VLOOKUP(MAX(B2:B5),A2:B5,1,0). I get N/A. Any idea how to solve this problem? I would expect Sam as the value.
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try this instead

=INDEX(A2:A5,MATCH(MAX(B2:B5),B2:B5,0))

if you really need to use vlookup(), swap columns A & B like this


Excel 2012
AB
1AB
21Bob
32Fred
43Bill
54Sam
6
7Sam
Sheet5
Cell Formulas
RangeFormula
A7=VLOOKUP(MAX(A2:A5),A2:B5,2,0)
 
Upvote 0
INDEX/MATCH is the proper solution, but, just for fun, to use VLOOKUP with the columns in the wrong order, try:
=VLOOKUP(MAX(B2:B5),CHOOSE({1,2},B2:B5,A2:A5),2,0)

M.
 
Upvote 0

Forum statistics

Threads
1,217,045
Messages
6,134,240
Members
449,862
Latest member
Muhamad Irfandi

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