+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting based on a range

  1. #1
    Registered User
    Join Date
    04-25-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2016
    Posts
    72

    Conditional formatting based on a range

    I have a form that people fill in, and there are columns across the top. Each row is another module bolted on to the final product. However, each column does not necessarily need inputs, depending on the Part type selected.

    In my example, we have 2 basic part types: Mechanical and Electrical.

    If a Mechanical Part is selected, I would like to grey out the fields I choose are not required (I've made it easy in this sample - no electrical variable fields needed for mech parts).

    The issue I am running into is that we add new mechanical parts occasionally to our list of options on the drop down, and I would like this logic to include the new parts (so it needs to be a range). However, I don't know if that is possible as I can only think of using the OR statement in the formatting which references individual cells.

    Hoping someone has a better way to do this. I'd like to avoid macros since this sheet will be sent out externally.

    In a perfect world, if a mechanical part was selected, I would actually not allow inputs in the electronic variables fields, but even just greying out is fine since the background formulas will ignore those inputs anyways.
    Attached Files Attached Files

  2. #2
    Forum Contributor jomaor1's Avatar
    Join Date
    10-08-2018
    Location
    Brasil
    MS-Off Ver
    Excel 2016
    Posts
    177

    Re: Conditional formatting based on a range

    Hi,

    You would do like this:

    • Select from B4 to C8
    • Click Home > Conditional Formatting > New Rule...
    • Select "Use a formula to determine which cells to format" (Last one)
    • Type this in the formula bar: "=($A4="Electric 1")+($A4="Electric 2")" (The "plus sign" means "OR")
    • Click Format... and in the Fill tab, click Pattern Style and choose the fourth one.
    • After that, click OK!

    Repeat like this:

    • Select from D4 to E8
    • Click Home > Conditional Formatting > New Rule...
    • Select "Use a formula to determine which cells to format" (Last one)
    • Type this in the formula bar: "=($A4="Mechanical 1")+($A4="Mechanical 2")" (The "plus sign" means "OR")
    • Click Format... and in the Fill tab, click Pattern Style and choose the fourth one.
    • After that, click OK!

    Cheers!
    Attached Files Attached Files
    John.

    "I excel at jumping to conclusions"

  3. #3
    Forum Contributor jomaor1's Avatar
    Join Date
    10-08-2018
    Location
    Brasil
    MS-Off Ver
    Excel 2016
    Posts
    177

    Re: Conditional formatting based on a range

    Sorry,

    I've failed to understand what you needed,
    Follow updated file

    Cheers!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-25-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2016
    Posts
    72

    Re: Conditional formatting based on a range

    Quote Originally Posted by jomaor1 View Post
    Sorry,

    I've failed to understand what you needed,
    Follow updated file

    Cheers!
    Thanks John, I can't check the updated formula until I get home (work policy regarding downloading excel files) but once I do I will let you know and send you some rep if it works.

+ 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. [SOLVED] Conditional formatting based on date range
    By PawelKos in forum Excel General
    Replies: 10
    Last Post: 07-01-2019, 12:47 AM
  2. [SOLVED] Conditional Formatting based on a range of cells?
    By darxide23 in forum Excel General
    Replies: 5
    Last Post: 11-06-2018, 08:07 PM
  3. [SOLVED] Conditional Formatting Based on Range
    By ExcelDavid in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-25-2015, 02:53 PM
  4. Replies: 3
    Last Post: 08-13-2013, 09:44 AM
  5. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  6. Conditional Formatting - Grey Out and Lock A range based on a cell value in that range
    By Excelgnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2012, 07:31 PM
  7. Conditional formatting based on date range
    By RGB in forum Excel General
    Replies: 3
    Last Post: 05-23-2006, 12:45 PM

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