+ Reply to Thread
Results 1 to 9 of 9

Highlight highest lowest value every nth row in a column

  1. #1
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Highlight highest lowest value every nth row in a column

    Hi all,

    Another question one day hopefully i will be able to contribute. I know it is possible to highlight the highest and lowest value in a given range, however what if i wanted to highlight the highest and lowest every nth row. I need to highlight the highest and lowest value every five rows i.e if i have a range of A1:A100 i woud like to highlight the highest and lowest value in A1:A5, A6:A10 and so on. is this possible? Thanks in advance for your help.

    Regards
    Dan
    Last edited by Cicada; 07-26-2011 at 06:41 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Highlight highest lowest value every nth row in a column

    Related to my other post from you about averaging,

    EDITED TO INCLUDE THIS COMMENT:
    I just noticed that you want to highlight the max and min...not calculate them.
    Consequently, the below may be irrelevant.
    ------------------------------------

    These regular formulas, when copied down, return the MIN value for each successive series of 5 cells
    B1: =MIN(INDEX(A:A,(ROWS($1:1)-1)*5+1):INDEX(A:A,(ROWS($1:1))*5))
    or
    B1: =MIN(OFFSET($A$1:$A$5,(ROWS($1:1)-1)*5,))

    and these regular formulas return the MAX
    C1: =MAX(INDEX(A:A,(ROWS($1:1)-1)*5+1):INDEX(A:A,(ROWS($1:1))*5))
    or
    C1: =MAX(OFFSET($A$1:$A$5,(ROWS($1:1)-1)*5,))

    Does that help?
    Last edited by Ron Coderre; 07-22-2011 at 08:57 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Highlight highest lowest value every nth row in a column

    1) Highlight your range of cells from A1: A100 (this is designed to work from row 1)

    2) Open the Format > Conditional Formatting and apply the following settings:

    Condition1: Formula Is: =OR(A1=LARGE(INDEX(A:A,FLOOR(ROW()-1,5)+1):INDEX(A:A,CEILING(ROW(),5)),1),A1=SMALL(INDEX(A:A,FLOOR(ROW()-1,5)+1):INDEX(A:A,CEILING(ROW(),5)),1))
    Format... Pattern: Yellow


    That will highlight the high and low of each 5 row group.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Highlight highest lowest value every nth row in a column

    and an alternative

    Conditional formatting
    + select the data
    + Format / Conditional Formatting
    with
    Conditional 1: Formular is =A1=MAX(OFFSET(A$1:A$5,5*INT((ROW(1:1)-0.5)/5),))
    Conditional 2: Formular is =A1=MIN(OFFSET(A$1:A$5,5*INT((ROW(1:1)-0.5)/5),))

    see the attached file for detail, such as an example for A1:A15
    Attached Files Attached Files
    Best regard, -)iger-/iger
    If you are pleased with a solution mark your post SOLVED.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,578

    Re: Highlight highest lowest value every nth row in a column

    Pl run this macro in your work sheet.You will get desired result.To change the colour of highlights change colorindex value in the macro.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 02-04-2013 at 07:09 PM.

  6. #6
    Forum Contributor
    Join Date
    04-19-2009
    Location
    Toulouse, France
    MS-Off Ver
    Excel 2010
    Posts
    130

    Re: Highlight highest lowest value every nth row in a column

    Thank you all for your help much appreciated. wow so many replys i dont know where to start, Will let you know how i get along. Thanks Again

    Regards
    Dan

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Highlight highest lowest value every nth row in a column

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  8. #8
    Registered User
    Join Date
    02-04-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Highlight highest lowest value every nth row in a column

    Hi everyone, I have an issue similar to this I have a spread sheet with several columns of data. I need to highlight and create a new column with the highest value in each row, using only column F, H, and J.

    Does that make sense? I have used conditional formatting to get it to highlight the highest in one row at a time, but I can not figure out how to copy the formatting down to the other rows. I am not even sure if that is possible, or I need to write the formatting code differently.

    Can someone offer a bit of help? Pretty please, and thank you with cherries on top

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Highlight highest lowest value every nth row in a column

    Jinxie,

    Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    New threads typically get faster response, too. Old threads are often only monitored by the original participants, greatly increasing response times.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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