Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel 2010 conditional formatting

Posted on 2011-09-15
14
Medium Priority
?
254 Views
Last Modified: 2012-05-12
I am trying to make a spreadsheet for checking supply voltages.  The sheet changes the local supply voltgage dependant on the country selected.  You are then shown the +/- tollerence for the supply.  This then gives me a cell to put the actual value in H1, the expected value in I1 and then the low and high tolerence in J1 & K1 respectively.

I am trying to somehow conditionally format the background colour of H1 depending on its value with if H1=I1 then it would be green and then change colour gradually to red if I head towards the limits.  It would then remain red if over the limit.

Thanks in advance
0
Comment
Question by:simonwait
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 2
14 Comments
 
LVL 26

Expert Comment

by:pony10us
ID: 36544130
While I don't have Excel 2010 I would think it would be similar to 2007.

In 2007 you would select the cells you want to color and then select conditional formating.  
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36545083
simonwait,

Are you looking for a gradient within the cell?

Patrick
0
 
LVL 26

Expert Comment

by:pony10us
ID: 36545181
Good question Patrick.

Here is a file containing two examples.  The first is in column I where I used the conditional formating color scale option which creates a gradient. You can set upper and lower limits for the gradient. The second is column J where I just wanted to compare column I to two set values and so I only needed 3 colors. Bottom, middle and top. Vacation-Accrual.xlsx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36545205
Right, but I don't think those are particularly useful for a within-cell gradient.

This seems to work, and will for all versions of Excel:

1) Shrink the column width for N:AG to 2

2) Select N1:AG1, and set the fill color to green

3) Create a formula based CF rule, using formula

=IF($H1<=$I1,($I1-$H1)/($I1-$J1),($H1-$I1)/($K1-$I1))>(34-COLUMN())/20

and fill color red

Now the amount of green and red visible will depend on how far you are from the expected value.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 36545224
Correction - In Column J I was looking for specific words contained in column J that were placed there by a formula in that cell which does a comparison.

=IF(AND(I22>0,I22<($I$3-40)),"WARNING Will Robinson WARNING",IF(I22>($I$3-39),"SYSTEM OVERLOAD way too much vacation","Whew - I'm safe"))

I then used conditional formating to look for "WARNING", "OVERLOAD" and "Whew" and assign a color based on results.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 36545291
Oh - I see.  

You are programming so that if the value in one specific cell changes the gradient level will change accordingly.  

I was thinking more along the lines that as each column is completed you wanted to set it's color. (basically a one time setting per cell).

0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36545348
>>You are programming so that if the value in one specific cell changes the gradient level will change accordingly.

That's what I THINK the Asker wants, but who knows?

:)
0
 
LVL 1

Author Comment

by:simonwait
ID: 36545762
What I was meaning was that say the target voltage is 220 but you are allowed down to 190 and up to 250 then 220 would be represented as green with 230 still green with a red tinge!  By the time we get to 250 it would be red.  The same would be true going the other way.  Incidentally all the values are variable and based on the values in the structure set out at the top of the question
0
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 800 total points
ID: 36546233
Please have a look at this file:

 Q-27310235.xlsx

It follows the technique I described in http:#a36545205
0
 
LVL 26

Accepted Solution

by:
pony10us earned 1200 total points
ID: 36546397
And using the conditional formating to change the color of cell H1 based on the settings you gave last you could look at this.  I placed a screen shot of the settings on the spreadsheet.

I think Patrick's is easier to read though.  The only thing I noticed with his was that if I went to 250 I still had 1 green square but that should be easy to fix. temp-gauge.xlsx
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36546449
>>The only thing I noticed with his was that if I went to 250 I still had 1 green square but that should be easy to fix.

Yup.  Instead of using

    =IF($H1<=$I1,($I1-$H1)/($I1-$J1),($H1-$I1)/($K1-$I1))>(34-COLUMN())/20

use

    =IF($H1<=$I1,($I1-$H1)/($I1-$J1),($H1-$I1)/($K1-$I1))>=(34-COLUMN())/20

It all depends on how you want to treat the boundary condition.  If the low/high points should still be considered acceptable, leave it as is.  If we should reject at the boundary, make the change above.
0
 
LVL 1

Author Closing Comment

by:simonwait
ID: 36551148
Pony10us, your solution is exactly what I needed infact I thought I had tried that previously but obviously not quite.  I did actually think of changing to Patrick's solution as it is very clear but it wont quite fit in with my project.  Hence the points split, I hope you both find this fair
0
 
LVL 26

Expert Comment

by:pony10us
ID: 36551799
Glad we could be of help.  It's too bad that Patrick's solution wouldn't work for you.  I still think it is much easier to read.  :)
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36552386
simonwait,

Glad to help :)

pony10us,

I kept trying to come up with a two-color scale, but I see now that your three-color scale was more workable.

Patrick
0

Featured Post

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.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

721 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