Array with Max for repeated value?

George J

Well-known Member
Joined
Feb 15, 2002
Messages
959
I'm going to give the long explanation as this is confusing me - my apologies.

In a workbook I have a client name in column A. I am trying to lookup this name (minus last character) on my "Evidence" sheet. I want to return the data from Column L on that sheet, but if the client name is repeated more than once, to look at column G and return column L's text for the highest value in column G for that client.

I hope that makes sense.
Due to the data comping from a program, I need to drop the last character of the client when searching, otherwise it does not get found. This is even after using clean and trim to get rid of any extra characters (with a client of 20 characters on both sheets it did not find the text even though i checked the string length for both was 20 - hence my dropping the last character, which got that part to work).

This is what I am left with so far.
=SUMPRODUCT(--(ISNUMBER(MATCH(F2&"*",Extracted!$M$6484:$M$6488,0)))*(MAX(Extracted!$G$6484:$G$6488)),(Extracted!$L$6484:$L$6488))

Any suggestions? :eek:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
No longer need to drop the last character, but the original data has extra characters still.

Still no closer as I need the match to look for the partial client name, but not sure how to put that into an array.
=MAX(IF(INDEX(Extracted!$G$1:$G$7000,MATCH(LEFT(A29,LEN(A29))&"*",Extracted!$M$1:$M$7000,0),1),Extracted!$G$1:$G$7000))
 
Upvote 0
Thanks to all who had a look at this.
It's probably a bit messy and could be simplified, but it works (will test it more later)

=SUMPRODUCT(MAX(--(Extracted!$M$2:$M$7000=INDEX(Extracted!$M$1:$M$7000,MATCH(A46&"*",Extracted!$M$1:$M$7000,0)))*(Extracted!$G$2:$G$7000)))
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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