+ Reply to Thread
Results 1 to 7 of 7

conditionally format matchin values in row & range one row above & one below

  1. #1
    Registered User
    Join Date
    07-20-2022
    Location
    Berlin
    MS-Off Ver
    365
    Posts
    2

    conditionally format matchin values in row & range one row above & one below

    I want to conditionally format the matching values of all the numbers in a row and in a range that is one row above and one row below because I have multiple rows with various types of values. How do I accomplish this?

    There is an example what I want to do:
    Cape.PNG
    (I painted this by hand but I want to achieve this with conditional formatting)
    Last edited by AliGW; 07-21-2022 at 01:44 AM. Reason: Thread title improved - please make your thread titles explicit & not generic in future.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How can I format like this? Is this even possible?

    I moved everything down one row so we're looking at data in A2:D7 now.

    Highlight A2:D7 > Conditional Formatting > New Rule > Use a formula
    =OR(COUNTIF($A1:$D1,A2),COUNTIF($A3:$D3,A2))

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,092

    Re: How can I format like this? Is this even possible?

    You can probably use COUNTIF. You'd need two conditions, one to check the row below, and one to check the row above.

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,092

    Re: How can I format like this? Is this even possible?

    Or you could go with post #2 …

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

    Re: How can I format like this? Is this even possible?

    Select A1:D5 . Apply Cf.
    Formula

    =(COUNTIF($A1:$D2,A1)+IF(ROW()>1,COUNTIF(OFFSET($A1:$D1,-1,0),A1)))>1
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2501 (Windows 11 24H2 64-bit)
    Posts
    89,014

    Re: conditionally format matchin values in row & range one row above & one below

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done this for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    07-20-2022
    Location
    Berlin
    MS-Off Ver
    365
    Posts
    2

    Re: How can I format like this? Is this even possible?

    It did worked. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 01-25-2020, 05:18 PM
  2. Determine if Cell Format is M/D/YYYY and Change to Numeric Value in YYYYMMDD Format
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2017, 06:16 PM
  3. Replies: 3
    Last Post: 02-24-2015, 02:58 AM
  4. [SOLVED] help on vba code to change the error date format as standard format mm/dd/yyyy
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2013, 01:10 AM
  5. Replies: 3
    Last Post: 05-15-2013, 12:16 AM
  6. Replies: 1
    Last Post: 09-10-2005, 05:05 AM
  7. Replies: 1
    Last Post: 01-31-2005, 09:06 AM

Tags for this Thread

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