Rounding within a range

H

husker

Is it possible to analyze and round a number based on the following
example:

If number is between *.25 and *.74 round to *.5
If number is between *.75 and *.99 round to next higher whole #.
If number is between *.01 and *.24 round to next lower whole #.

Thanks
 
S

Spreadsheet

=IF(A1-TRUNC(A1)<0.25,TRUNC(A1),IF(AND(A1-TRUNC(A1)<0.75,A1-TRUNC(A1)>=0.25),TRUNC(A1)+0.5,IF(A1-TRUNC(A1)>=0.75,TRUNC(A1)+1)))

I bet there's a less messy way, but this will work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Rounding up 7
VLookup Within a Range 2
Round up price to end .99 2
Rounding down to .00 .25 .50 .75 1
Modify Rounding Rules 12
rounding off numbers 4
If Function and rounding numbers 3
Rounding numbers 4

Top