Look up values in range and find maximum value in column

rsutton1981

New Member
Joined
Mar 9, 2016
Messages
47
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am looking for a code that will look for a parameter in a column, search another sheet for all instances of the parameter and then find the maximum value recorded against the parameter.

e.g
in the review sheet I have a column with apples, oranges, etc
I want to search the assessment sheet for all instances of apples and then take the maximum value in Column L, and place it next to the apples in the review sheet.
I also need the same calculation to do the average rather then the max.

This has had me stumped all day.

Thanks in advance
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You could use an array formula (Ctrl+Shift+Enter) for the largest: =MAX((A1=Assessment!$A$1:$A$100)*Assessment!$L$1:$L$100)

And another array formula for the average: =AVERAGE((A1=Assessment!$A$1:$A$100)*Assessment!$L$1:$L$100)

But sent the upper limit of the ranges to whatever you need.
 
Upvote 0
That AVERAGE formula won't work, since it will include a lot of 0 values. Maybe something like:

=AVERAGE(IF(Assessment!$A$1:$A$100=A1,Assessment!$L$1:$L$100))

with CSE.

or

=AVERAGEIF(Assessment!$A$1:$A$100,A1,Assessment!$L$1:$L$100)

normally entered.
 
Last edited:
Upvote 0
If you want to not include the zeros in the average, you might try: =SUMIF(Assessment!$A$1:$A$100,A1,Assessment!$L$1:$L$100)/COUNTIFS(Assessment!$A$1:$A$100,A1,Assessment!$L$1:$L$100,"<>0")

HA! or Eric's more simplistic version.
 
Upvote 0
is there a way of adding a second search parameter to the formula. ie if(Assessment!$O$1:$O$100)="Y" and SUMIF(Assessment!$A$1:$A$100,A1,Assessment!$L$1:$L$100)/COUNTIFS(Assessment!$A$1:$A$100,A1,Assessment!$L$1:$L$100,"<>0")
 
Upvote 0
You should update your user profile to show which version of Excel you're using, since that affects the functions that you can use. For example, if you have the AVERAGEIFS function, try

=AVERAGEIFS(Assessment!$L$1:$L$100,Assessment!$A$1:$A$100,A1,Assessment!$O$1:$O$100,"Y")

or you can use this array formula on older versions of Excel:

=AVERAGE(IF((Assessment!$A$1:$A$100=A1)*(Assessment!$O$1:$O$100="Y"),Assessment!$L$1:$L$100))

with CSE.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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