?
Solved

Excel 2007 Conditional formatting based on a function value.

Posted on 2011-10-03
8
Medium Priority
?
365 Views
Last Modified: 2012-05-12
Hi,

I am trying to work out how to do this in Excel 2007.

I would like to do a conditional formatting based on a return
value of a function.

If the function returns "True". I want the cell formatted as green.
If the function returns "False", I want the cell formatted as red.

So I have created the VBA function, what I am stuck on is how to do the
conditional formatting in Excel 2007.

I am looking for the basic steps.

Thanks,

Ward.

 
0
Comment
Question by:whorsfall
8 Comments
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36902771
On the Home tab - conditional formatting, then New rule... and choose 'Use a formula to determine which cells to format.  Then you can enter your function, and select the formatting you want
0
 
LVL 31

Accepted Solution

by:
gowflow earned 2000 total points
ID: 36902828
Check out this file it has conditional formating in Col A as you requested to view the format available from the Home Menu choose Conditional Formating dropdown arrow and choose Manage Rules you will see how I set it up.

Pls feel free to ask more if you need help or adpatation with your own workbook
gowflow
TrueFalse-Cond-formating.xlsx
0
 
LVL 1

Author Comment

by:whorsfall
ID: 36902848
Hi,

Thanks for that but I am a bit confused. I can see how to set the formatting for true,
but how then do I format it for False?

Thanks,

Ward.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 31

Expert Comment

by:gowflow
ID: 36902926
did you check the file I posted ?
gowflow
0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36902931
You use two conditional formatting rules.
One rule for TRUE and one rule for False.
   OR - you can format the cell for FALSE and only test for TRUE.
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36902947
I presume you have loaded the file I posted
1) once loaded goto menu Home and click on the arrow under Conditional formating
2)Select Manage rules
3) you will see 2 rules the first one Cell Value = FALSE then Red color and the second one Cell value = TRUE then Green color.
4) if you want to modify this click on the rule you want click edit then you will see the data and can change the conditio nand the color.

gowlfow
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36903041
Again when you say
but how then do I format it for False?
If your confused on how empty cells are turned Red is that by delfault empty = 0 = false so if your not happy with all cells turning red by default then change the output of your formula to be say Yes and No and then affect Yes to Green and No to Red this way only input of formula will be colored and empty cells will remain blank !!!
gowflow
0
 
LVL 1

Author Closing Comment

by:whorsfall
ID: 36906533
Excellent !
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question