Taconumber
New Member
- Joined
- Dec 5, 2021
- Messages
- 4
- Office Version
- 365
- 2021
- Platform
- Windows
Howdy,
I am stuck on a formula and am hoping someone here can help me.
Essentially, i am doing a tolerance sheet. Showing the design value, the actual value and the difference between the two. There is a tolerance of +0.015 and -0.000. So if the difference falls out of this range i need it to randomly generate a number that is between the design value and the design tolerance.
I have come up with this. =IF(C7>$B$2,RANDBETWEEN(A7-$B$3,A7+$B$2) BUT it only generates a integer..
and if i use the formula =IF(C7>$B$2,RANDBETWEEN(A7-$B$3,A7+$B$2)+RAND()) It generates a value that is out of the tolerance range because it generates the RANDBETWEEN and adds the RAND whch returns a decimal.
I have attached a example work book.
I am stuck on a formula and am hoping someone here can help me.
Essentially, i am doing a tolerance sheet. Showing the design value, the actual value and the difference between the two. There is a tolerance of +0.015 and -0.000. So if the difference falls out of this range i need it to randomly generate a number that is between the design value and the design tolerance.
I have come up with this. =IF(C7>$B$2,RANDBETWEEN(A7-$B$3,A7+$B$2) BUT it only generates a integer..
and if i use the formula =IF(C7>$B$2,RANDBETWEEN(A7-$B$3,A7+$B$2)+RAND()) It generates a value that is out of the tolerance range because it generates the RANDBETWEEN and adds the RAND whch returns a decimal.
I have attached a example work book.
tolerance workbook.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | |||||||||||
2 | Upper Tolerance | 0.015 | |||||||||
3 | Lower Tolerance | 0.000 | |||||||||
4 | |||||||||||
5 | DIFF | ||||||||||
6 | 456.983 | 457.017 | 0.034 | 457.000 | FALSE | 456.998 | |||||
7 | 456.897 | 456.883 | -0.014 | FALSE | 457.993 | ||||||
8 | 456.955 | 456.942 | -0.013 | FALSE | 457.054 | ||||||
9 | 456.888 | 456.923 | 0.035 | 457.722 | FALSE | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F6 | F6 | =IF(C6>$B$2,RANDBETWEEN(A6,I6)) |
G6:G9 | G6 | =IF(C6<$B$3,RANDBETWEEN(A7-$B$3,A7+$B$2)+RAND()) |
F7:F9 | F7 | =IF(C7>$B$2,RANDBETWEEN(A7-$B$3,A7+$B$2)+RAND()) |
I6 | I6 | =A6+$B$2 |
C6:C9 | C6 | =B6-A6 |