Conditional Formatting based on part of a dynamic range

Sundance0315

New Member
Joined
Apr 5, 2018
Messages
2
I have a dynamic range (sheet 2 column d) called "category" that is used as the source data for a data validation drop down list (sheet 1 column e).

The dynamic range consists of 2 types of data (inputs and outputs). Over time this range will grow as the user adds rows for new 'inputs' or 'outputs'. I have to keep all of the data in the same column in order for the drop down list to work.

The dynamic range looks something like this:
INPUTS
aaa
bbb
ccc
ddd
OUTPUTS
aaa
bbb
ccc
What I need to do now is add conditional formatting to sheet 1 column e that makes the text for inputs 'green' and the text for outputs 'red'. the challenge being that over time the list will grow and the only thing separating the two types of data is the text 'INPUTS' or 'OUTPUTS'

I was hoping to find a non VBA solution for this, but there may not be.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Welcome to the Board!

What I need to do now is add conditional formatting to sheet 1 column e that makes the text for inputs 'green' and the text for outputs 'red'
In your example, you show the same value under both INPUTS and OUTPUTS. Is that really a possibility?
If so, in those instances, how does it know which color to choose, since the items is found under both INPUTS and OUTPUTS?
 
Upvote 0
Thank you for your reply. In the example the where i listed the same values under both INPUTS and OUTPUTS that would not actually happen. Each input and output is unique. Is there a way with conditional formatting to use a formula to have it look through the column and see if the text is between "Input" and "Output"? If so this would always be and "input". If the text is below the word "output" then it will always be an "Output". Does that make sense?
 
Upvote 0
Assuming that OUTPUTS always appears below INPUTS in your category list, here are the two Conditional Formatting Formulas you need (written for cell E2):

For green:
<match("outputs",sheet2!d:d,0)[ code]
Code:
=MATCH(E2,Sheet2!D:D,0) < MATCH("OUTPUTS",Sheet2!D:D,0)
For red:
Code:
=MATCH(E2,Sheet2!D:D,0) > MATCH("OUTPUTS",Sheet2!D:D,0)
</match("outputs",sheet2!d:d,0)[>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top