Thursday, August 30, 2012

Rounding value of a cell to the nearest quarter

How to write a formula which will automatically round the value of a cell to the nearest quarter?


Question:

How to write a formula which will automatically round the value of a cell to the nearest quarter?



Suppose if you are having value 2.19 in Cell A1 and you want to convert it to the nearest quarter value, that is convert 2.19 to 2.25, and display it to the Cell B1.

Solution:

Insert the following formula to the Cell B1:
=if(mod(A1;0.25)<0.125;A1-mod(A1;0.25);A1+(0.25 - mod(A1;0.25)))

This will give you the result:
2.25 in the Cell B1.

And if you are having 2.39 then it will convert it to 2.5 (as it is nearest quarter value to 2.39)

I hope this helps you.

I hope the above solution will help you, and if you need more help then please do comment below on this blog itself I will try to help you out.

If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 


Thanks,
Kishan,

No comments:

Post a Comment