+ Reply to Thread
Results 1 to 11 of 11

Get Maximum and Minimum Value from a range of cells that contains certain values

  1. #1
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Get Maximum and Minimum Value from a range of cells that contains certain values

    Hi, I,am new to this forum, Iam working in a project in wicth i
    I want to look for a range of all the cells that contains the value of
    "warm Up Time" and than find the Maximum and minimum from
    that range.
    Thanks

  2. #2
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Please upload a sample workbook with the description and sample output. Thank you.

  3. #3
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    This is a partial copy of the woorksheet,
    as a mention before what Iam trying to
    acomplish is find the data for example
    all the values "warm up Start" and
    get the max and min for that value.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Hi,

    Please see codes,
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Why do you even need a code for this task? A pivot Table

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Or maybe, formulae?

    Note that J4 is an array formula an must be confirmed with Ctrl+Shift+Enter not just enter, before dragging across to K4 and then down.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Thank you all for replying,I tried Tangangtanga code but I notice that I needed to enter
    the starting range in the example code in this case is B4. But, I not allways the starting point is
    B4. Thats why I would like to do do search by Name in this case "Warm up Start" then
    "Delivery 1" ect.ect. and if i find, for example delivery 1, I want to get the max and Min for
    the range. In other words if the code finds the word "Warm up start" five times, I want
    the max and min of that five reading.
    I want to use vba since Iam more familiar the VBA than formulas.
    Thanks again

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Hello jotol,

    This code might be closer to what you want to do using VBA. The entire worksheet is searched for the term "Warm Up Start" and the values from 2 columns to right of the cell are added to an array. After all cells have been searched, the minimum and maximum values are taken from the array and stored into 2 separate variables:Min and Max. A message box then dispalys the results. If no match is found, nothing will be displayed.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Quote Originally Posted by jotol View Post
    .... I want to use vba since Iam more familiar the VBA than formulas.
    Thanks again
    Why should this be? Excel is built on formulae, and in my opinion, this should be your first line approach, not the last!

  10. #10
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    Thank you Leith Roos the code works perfectly. This was what I was looking for.
    Jotol

  11. #11
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: Get Maximum and Minimum Value from a range of cells that contains certain values

    I needed to enter
    the starting range in the example code in this case is B4. But, I not allways the starting point is
    B4. Thats why I would like to do do search by Name in this case "Warm up Start" then
    "Delivery 1" ect.ect. and if i find, for example delivery 1, I want to get the max and Min for
    the range. In other words if the code finds the word "Warm up start" five times, I want
    the max and min of that five reading.
    lol my bad, if only you briefly explained what you really need.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1