32CARDS
Board Regular
- Joined
- Jan 1, 2005
- Messages
- 123
A micrometer may measure sizes and need to be lathed into square rounded settings.
Either 1 or .50, but sometimes it needs to be specific and adjustments vary.
How is the formula constructed or a VBA coded Function.
Here is the 3 "If" "and" "then" scenarios.
x = a cell range
if (x < 0.25) then x = 0 end if
if (x >= 0.25) and (x < 0.75) then x = 50 end if
if (x >= 0.75) then x = 1 end if
Sometimes I need to adjust to a "50" to a "1" in the decimal
So if a measurement is 57.73 it may become 58 if the setting is 1
But if the setting is 50, then it becomes 57.50
The range is 3 cells.
Actual
C4:C6 ( If)
ROUNDED
E4:E6 (Then)
Thanks
Either 1 or .50, but sometimes it needs to be specific and adjustments vary.
How is the formula constructed or a VBA coded Function.
Here is the 3 "If" "and" "then" scenarios.
x = a cell range
if (x < 0.25) then x = 0 end if
if (x >= 0.25) and (x < 0.75) then x = 50 end if
if (x >= 0.75) then x = 1 end if
Sometimes I need to adjust to a "50" to a "1" in the decimal
So if a measurement is 57.73 it may become 58 if the setting is 1
But if the setting is 50, then it becomes 57.50
The range is 3 cells.
Actual
C4:C6 ( If)
ROUNDED
E4:E6 (Then)
Thanks