Question on limiting range

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freehockey16
    New Member
    • Apr 2007
    • 2

    #1

    Question on limiting range

    I have a question and would appreciate anyones guidance. I have a list of around 2000 entries each having 7 rows (all entries are numbers). Now I need to find the max value of a certain cell within a range that is limited by other values. So, say I have columns A-G and 2000 rows. I need to find the max value of A in a range where G=X and F=Y. Any help on how to do this? I know how to find the max value of a range, but just don't know how to limit it to only the rows that have a certain value of G and F. Thanks in advance.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by freehockey16
    I have a question and would appreciate anyones guidance. I have a list of around 2000 entries each having 7 rows (all entries are numbers). Now I need to find the max value of a certain cell within a range that is limited by other values. So, say I have columns A-G and 2000 rows. I need to find the max value of A in a range where G=X and F=Y. Any help on how to do this? I know how to find the max value of a range, but just don't know how to limit it to only the rows that have a certain value of G and F. Thanks in advance.
    Though there are probably more sophisticated and elegant methods, I'd suggest the simplest would be to loop through all the rows in a VBA macro. For each row, test your various columns against your criteria. If they match, then compare it to your current max value and replace if it's higher.

    Comment

    Working...