+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting multiple row selection based on cell value

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Question Conditional formatting multiple row selection based on cell value

    Hello clever folk

    I think I need help with adding multiple OR statements in Conditional formatting.

    This is what I need:

    I have a table from A1 - E20. Column A is numbered 1 - 20
    I need something to select/highlight the row with lets say#5, 12, 18, 20.

    I can do it setting a rule for each number but would like to just have one rule that looks for 5, 12, 18, 20 & highlights those rows.

    Thanks
    Last edited by mrbret; 01-27-2016 at 10:51 AM. Reason: update subject

  2. #2
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Conditional formatting help

    Each 'or' will have to be fully qualified:

    It can't just be 'Value = 5 or 12 or 18 or 20'
    it has to be 'Value = 5 or Value = 12 or Value = 18 or Value = 20'
    Last edited by kadeo; 01-27-2016 at 10:19 AM.
    Please click *Add Reputation if I've helped

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Conditional formatting help

    Could you give an example of how it would look for column A1:A20 looking for numbers 5, 12, 18.

    I assume this formula would go in the bottom selection in Conditional Formatting when you enter a formula.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting help

    The title of this thread should be improved following the rules of the forum and you will also get more traffic to the problem posed.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


    If this is what you are looking for, this is the formula in Conditional Formatting that will achieve this effect
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Capture.JPG
    Last edited by newdoverman; 01-27-2016 at 10:48 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Re: Conditional formatting help

    Subject updated.

    Yes that works perfectly thanks.

    Could you explain why you only use A1 vs A1:A20 though? Just for future reference.

    Tanks very much

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional formatting multiple row selection based on cell value

    The active cell is always the key cell for Conditional Formatting. The range A1:E20 was selected as it was the range to be affected by the formatting then, the Conditional Formatting formula was applied.

    The selection of the range replaces the statement A1:A20.
    If you entered the formula =OR(A1:A20=5,A1:A20=12,A1:A20=18,A1:A20=20) the whole column A would be formatted. If you entered the formula =OR($A1:$A20=5,$A1:$A20=12,$A1:$A20=18,$A1:$A20=20) the whole range would be formatted. However if you entered the formula in the worksheet and produced TRUE and FALSE down a column (say column G) you could use a formula in Conditional Formatting like this and it will work if you selected A1:E20 and then entered the Conditional formatting formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Instead of entering the range each time with the OR function, the formula could be shortened to the following filled down the column (G)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The result on your worksheet would be like this. Capture 2.JPG

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Last edited by newdoverman; 01-27-2016 at 11:26 AM.

+ 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: 6
    Last Post: 01-08-2016, 06:44 PM
  2. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  3. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  4. Replies: 3
    Last Post: 11-04-2013, 12:47 AM
  5. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  6. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

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