P
ProHealth, Inc.
I'm trying to write a formula to round a number with the following
conditions:
1. If the number in the thousandths place is a 0, 4, 5, 6, 7, 8 or 9
round to the hundredths place
2. If the number in the thousandths place is a 1, 2, 3 or 4 add 0.01
and round to the hundredths place
Here is the formula I have so far (there's probably a cleaner/shorter
way of doing this):
=IF(AND(MID(Q23,FIND(".",Q23)+3,1) >=5,(MID(Q23,FIND(".",Q23)+3,1)
<=9)), ROUND(Q23,2), IF(MID(Q23,FIND(".",Q23)+3,1)=0, ROUND(Q23,2),
CEILING(Q23,0.01)))
I'm having trouble getting it to round correctly if the number in the
thousandths place is a 0.
Examples:
10.9607000 is being rounded to 10.97 instead of 10.96
19.8401000 is being rounded to 19.85 instead of 19.84
conditions:
1. If the number in the thousandths place is a 0, 4, 5, 6, 7, 8 or 9
round to the hundredths place
2. If the number in the thousandths place is a 1, 2, 3 or 4 add 0.01
and round to the hundredths place
Here is the formula I have so far (there's probably a cleaner/shorter
way of doing this):
=IF(AND(MID(Q23,FIND(".",Q23)+3,1) >=5,(MID(Q23,FIND(".",Q23)+3,1)
<=9)), ROUND(Q23,2), IF(MID(Q23,FIND(".",Q23)+3,1)=0, ROUND(Q23,2),
CEILING(Q23,0.01)))
I'm having trouble getting it to round correctly if the number in the
thousandths place is a 0.
Examples:
10.9607000 is being rounded to 10.97 instead of 10.96
19.8401000 is being rounded to 19.85 instead of 19.84