If between a and b but not between x and y- Standard deviation

Nick_b

New Member
Joined
Feb 14, 2016
Messages
3
I am trying to highlight cells which are between two numbers but not between two other numbers in order to highlight data values used to create a histogram using standard deviation. I understand that I would use conditional formatting but I'm not sure how to set up the equations. Here is briefly what I am trying to achieve and my data:

mean + 1 sd: .7685
mean - 1 sd: .7313
mean + 2 sd: .7871
mean - 2 sd: .7126
mean + 3 sd: .8058
mean - 3 sd: .6940

- highlight red if it is not between .6940 and .7685 I have this formula as '=OR(B5<.6940,B5>.7685)'
- highlight light blue if it is between .7313 and .7685
- highlight medium blue if it is between .7126 and .7871 but not between .7313 and .7685 (or another way to look at it would be to highlight light blue it was between .7126 and .731 or between .7685 and .7871)
- highlight dark blue if it is between .6940 and .7685 but not between .7126 and .7871.

I am an engineering teacher and my students will be using the data to find 27 hardwood cubes which will be glued into 6 pieces to make a 3d puzzle cube. This will incorporate statistics and quality control
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Conditional Formatting (CF) works only on TRUE/FALSE, so you need to construct your rules to return 1 of those. So that 1str formula should work...
=OR(B5<.6940,B5>.7685)

To actually apply the CF
1. highlight the range you want to apply the conditional formatting to
2. on the home tab, styles, select CF
3. select new rule, select use formula
4. Enter =OR(B5<.6940,B5>.7685) Format Fill RED

Repeat 3 and 4 with each new rule.

I often construct the rule IN the worksheet, so that I can make sure I an getting the return I need. Try this and let me know how you make out
 
Upvote 0
Thank you. I understand the procedure to apply the conditional formatting and have for the example formula I gave. It works great! The other formulas are where I am having trouble. I want to highlight the values between two numbers but not include a subset of those. For example highlight all the values within +/- 2 standard deviations but not include the values +/- 1 standard deviation. I understand the basic formula. It is not including the values in the middle I need help with. I have linked a url to download the file if that would be a help. https://drive.google.com/file/d/0BxlpOUh650GLNFQxRmZHU1Z3OE0/view Thank you again

Conditional Formatting (CF) works only on TRUE/FALSE, so you need to construct your rules to return 1 of those. So that 1str formula should work...
=OR(B5<.6940,B5>.7685)

To actually apply the CF
1. highlight the range you want to apply the conditional formatting to
2. on the home tab, styles, select CF
3. select new rule, select use formula
4. Enter =OR(B5<.6940,B5>.7685) Format Fill RED

Repeat 3 and 4 with each new rule.

I often construct the rule IN the worksheet, so that I can make sure I an getting the return I need. Try this and let me know how you make out
 
Upvote 0
Hi,

You can use the following formulas for Conditional Formatting your cell(s), I assume when you say BETWEEN and NOT BETWEEN means does not include the referenced parameters, e.g. <, >, NOT <=, >=


Excel 2010
ABCDE
2mean + 1 sd: .76850.7685FALSEFormat Fill Red
3mean - 1 sd: .73130.7313FALSEFormat Fill Light Blue
4mean + 2 sd: .78710.7871FALSEFormat Fill Medium Blue
5mean - 2 sd: .71260.7126FALSEFormat Fill Dark Blue
6mean + 3 sd: .80580.8058
7mean - 3 sd: .69400.6940
Sheet1
Cell Formulas
RangeFormula
D2=OR(B5<0.694,B5>0.7685)
D3=AND(B5>0.7313,B5<0.7685)
D4=OR(AND(B5>0.7126,B5<0.7313),AND(B5>0.7685,B5<0.7871))
D5=AND(B5>0.694,B5<0.7126)
 
Upvote 0
Thank you, Thank you, Thank you! This is exactly what I needed! I did change the formulas to include the equal where necessary and changed the last formula to the same format as the fourth but it works flawlessly. I am amazed at how fast I recieved replies as well. Thank you again.

Hi,

You can use the following formulas for Conditional Formatting your cell(s), I assume when you say BETWEEN and NOT BETWEEN means does not include the referenced parameters, e.g. <, >, NOT <=, >=

Excel 2010
ABCDE
2mean + 1 sd: .76850.7685FALSEFormat Fill Red
3mean - 1 sd: .73130.7313FALSEFormat Fill Light Blue
4mean + 2 sd: .78710.7871FALSEFormat Fill Medium Blue
5mean - 2 sd: .71260.7126FALSEFormat Fill Dark Blue
6mean + 3 sd: .80580.8058
7mean - 3 sd: .69400.6940

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2=OR(B5<0.694,B5>0.7685)
D3=AND(B5>0.7313,B5<0.7685)
D4=OR(AND(B5>0.7126,B5<0.7313),AND(B5>0.7685,B5<0.7871))
D5=AND(B5>0.694,B5<0.7126)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Thank you, Thank you, Thank you! This is exactly what I needed! I did change the formulas to include the equal where necessary and changed the last formula to the same format as the fourth but it works flawlessly. I am amazed at how fast I recieved replies as well. Thank you again.

You're welcome, glad it worked for you, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,214,901
Messages
6,122,157
Members
449,068
Latest member
shiz11713

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