By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Question on limiting range

P: 2
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.
Apr 7 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
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.
Apr 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.