# Formula for a Deviation

#### Kars1995

##### New Member
Hello,

I am new on this forum and making a quality check sheet for different parts. The idea is that they measure parts with a 'digital marking gauge'. In the sheet I have a cell with the dimension and a cell the maximal deviation.

In an other cell they need to put in the measured dimension. If it is more or than the deviation it need to give FAIL if it is between the deviation it needs to give APPROVED. I tried several formulas but I don't succeed. I hope you can help me with this matter!

Kind regards,

Kars

Dimension
 ±

<tbody>
</tbody>
 Measured

<tbody>
</tbody>
Approved/Fail
 15,6

<tbody>
</tbody>
 0,1

<tbody>
</tbody>
...

<tbody>
</tbody>

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### Tetra201

##### MrExcel MVP
Try this:

=IF(ROUND(ABS(C2-A2),6)<=B2,"Approved","Fail")

#### Kars1995

##### New Member
Thanks for your help and reply , but unfortunately it does not work.
It needs to be a general formula that I can apply on differten spreadsheets/quality checks.
I made an example, hope you guys can help me!

#### peterhinton

##### Active Member
=IF(AND(D2>(D2-C2),D2<(B2+C2)),"approved","fail")

#### AlanY

##### Well-known Member
try this in E25 and copy down

=IF(AND(D25<=B25+C25,D25>=B25-C25),"Approved","Fail")

#### Tetra201

##### MrExcel MVP
Thanks for your help and reply , but unfortunately it does not work.
It needs to be a general formula that I can apply on differten spreadsheets/quality checks.
I am really curious to hear -- in which way does not my formula work for your examples?

Have you tried adjusting references? -- Like this:
=IF(ROUND(ABS(D25-B25),6)<=C25,"Approved","Fail")

Last edited:

#### Kars1995

##### New Member
Yes I did tried that. But everytime I fill in the formulas I get this error.

#### AlanY

##### Well-known Member
try this in E25 and copy down

=IF(AND(D25<=B25+C25,D25>=B25-C25),"Approved","Fail")

=IF(AND(D25<=B25+C25,D25>=B25-C25);"Approved";"Fail")

#### Kars1995

##### New Member

=IF(AND(D25<=B25+C25,D25>=B25-C25);"Approved";"Fail")

Sorry for the late response, but I finaly managed to have a good formula. This one works:

=IF(D27<(B27-C27);"Failed!";IF(D27>(B27+C27);"Failed!";"Approved")

Thank you everybody for your help

Replies
1
Views
602
Replies
6
Views
966
Replies
3
Views
400
Replies
0
Views
843
Replies
11
Views
422

1,191,697
Messages
5,988,164
Members
440,131
Latest member
EricMoz

### 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.

### Which adblocker are you using?

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

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