I need some help with custom rounding in decimals
Hi all,
I am trying to find a way to use custom rounding within a formula. I've tried using the AI formula generator, but it ignores that part of my request. I have also searched for help online but no luck.
Essentially I want to create the following custom rounding based on the outcome of a formula -
Between 0.01 and 0.24 - round down to 0
Between 0.25 and 0.74 - round to 0.5
Between 0.75 and 0.99 - round to 1
Any ideas?
Answers
-
Hi @thill
Assuming that the column that contains your formula is titled "Value", you can use the formula below=IF(AND(Value@row - FLOOR(Value@row, 1) >= 0.01, Value@row - FLOOR(Value@row, 1) <= 0.24), FLOOR(Value@row, 1),
IF(AND(Value@row - FLOOR(Value@row, 1) >= 0.25, Value@row - FLOOR(Value@row, 1) <= 0.74), FLOOR(Value@row, 1) + 0.5,
IF(AND(Value@row - FLOOR(Value@row, 1) >= 0.75, Value@row - FLOOR(Value@row, 1) <= 0.99), FLOOR(Value@row, 1) + 1, Value@row)))Explanation:
- FLOOR(Value@row, 1) extracts the integer part of the value (e.g., for 1.48, it gives 1).
- Value@row - FLOOR(Value@row, 1) calculates the decimal portion (e.g., 1.48 - 1 = 0.48).
- The IF logic:
- 0.01–0.24 → Round down to the nearest integer (FLOOR(Value@row, 1)).
- 0.25–0.74 → Round to 0.5 above the integer (FLOOR(Value@row, 1) + 0.5).
- 0.75–0.99 → Round up to the next integer (FLOOR(Value@row, 1) + 1).
Let me know if this helps.
Best Regards
Amit Wadhwani, Smartsheet Community Champion
Smartsheet CoE, Ignatiuz, Inc., Exton, PA
Did this answer help you? Show some love by marking this answer as "Insightful 💡" or "Awesome ❤️" and "Vote Up ⬆️"https://www.linkedin.com/in/amitinddr/
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!