• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

Excel 2010 conditional formatting

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
simonwait
Asked:
simonwait
  • 6
  • 6
  • 2
2 Solutions
 
pony10usCommented:
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
 
Patrick MatthewsCommented:
simonwait,

Are you looking for a gradient within the cell?

Patrick
0
 
pony10usCommented:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Patrick MatthewsCommented:
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
 
pony10usCommented:
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
 
pony10usCommented:
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
 
Patrick MatthewsCommented:
>>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
 
simonwaitAuthor Commented:
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
 
Patrick MatthewsCommented:
Please have a look at this file:

 Q-27310235.xlsx

It follows the technique I described in http:#a36545205
0
 
pony10usCommented:
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
 
Patrick MatthewsCommented:
>>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
 
simonwaitAuthor Commented:
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
 
pony10usCommented:
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
 
Patrick MatthewsCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now