# Data Manipulation

Sam Saha
Ranch Hand
Posts: 104
I am doing a data manipulation as below:

Requirement 1:
• Aspect ratios can range from 20 to 85 in increments of 5.
• Round to the nearest 5. Examples: >72.5 and < 77.5, round to 75. >77.5 and < 82.5, round to 80. Valid values include: 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85.
Requirement 2:
o Tire widths can range from 145 mm to 395 mm, in increments of 10 mm; e.g., 145, 155, 165, 175, … 395.
o Round to the nearest value ending in a 5. Examples: if >150 and <160, round to 155. If >220 and <230, round to 225.

For the Requirement 1 I am using the following function and it is working fine. But for the Requirement 2 this function is not working. I would appreciate if someone can help to write a function for the Requirement 2.

Here is the Function for Requirement 1 which is working perfectly. I want to implement a similar function for the requirement 2 for the incremental of 10 instead of 5.

Jeff Verdegan
Bartender
Posts: 6109
6
What did you try for #2, and in exactly what manner is it "not working"?

Paul Clapham
Sheriff
Posts: 21416
33
If your code for Requirement 1 is working perfectly, then the code you posted cannot be the actual code. Or at least if it is the actual code, lines 7 to 9 of your posted code are redundant and could be removed.

Sam Saha
Ranch Hand
Posts: 104
I tried this way but I am not getting correct values(10 intervals).

Jeff Verdegan
Bartender
Posts: 6109
6
Okay, so you're not getting the correct values. What values ARE you getting? The more relevant details you provide, the more likely it is that somebody will be willing and able to help you.

ItDoesntWorkIsUseless(←click).

Campbell Ritchie
Sheriff
Posts: 50171
79
Your requirements are written incorrectly. What do you do for a tyre exactly 160mm wide? You need to check for ≤ and ≥ symbols.