Forum Discussion

AWD's avatar
AWD
Copper Contributor
Apr 09, 2025

Returning max value from vector result based on lookup function

Hi

Im trying to return the maximum value from one column based on the value in a second equalling a specific value in a third (actually a separate sheet)

Sheet 1LocationInfo   Sheet 2AnalysisResults
        
SampleSiteValueMaxXY SampleSiteDepthValue
A-010.50.00000.0000 A-0120.1
A-021.20.00000.0000 A-0140.5
A-030.50.00000.0000 A-0210.1
A-041.00.00000.0000 A-0221.2
     A-0250.8
     A-0330.5
     A-0410.2
     A-0420.5
     A-0451.0
     A-0460.4

 

Bassicaly in the locationInfo sheet i want to have the maximum analysis value (in red) from value column in AnalysisResults sheet whereby it chooses the value when SampleSite column matches between the two sheets.

 

Ive tried using lookup, but just cant get it to select the max value.

 

While the data is on one sheet above, in reality it is in two.

 

Office 365, latest excel and windows

 

many thanks Andy

2 Replies

  • TrungQuan1602's avatar
    TrungQuan1602
    Copper Contributor

    =MAXIFS('AnalysisResults'!C2:C10,'AnalysisResults'!A2:A10,A2:A5)
     type in sheet LocationInfo. Try this

     

  • In B2 on LocationInfo:

    =MAXIFS(AnalysisResults!$B$2:$B$100, AnalysisResults!$A$2:$A$100, A2)

    Fill down.

Resources