Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

take computed value and round to 2 specific decimal places 1

Status
Not open for further replies.
Apr 17, 2001
28
CA
Hi there,

I have 2 scenarios that I want to cionvert my computed value to: if the value is greater than $xxx.50 then it should round to $xxx.90, if smaller than that, it needs to round down to $xxx.10

I've tried this: =IF(RIGHT(F2,3)>0.5,(LEFT(F2,2)+0.9),(LEFT(F2,2)+0.1)) but it is not sufficient. Any ideas? Thanks
 
=IF(VALUE(RIGHT(A1,2))>=0.5,(1-RIGHT(A1,2))+A1-0.1,(1-RIGHT(A1,2))+A1-0.9)

That is with data cell in a1, change to a1's to f2's if that is where your data cell is.

Blue
 
opps, forgot to add something:

=IF(VALUE(RIGHT(A1,2))>=0.5,(1-RIGHT(A1,2)/100)+A1-0.1,(1-RIGHT(A1,2)/100)+A1-0.9)
 
I was finding errors using the right function with zeros so I added the following:

=IF(VALUE(RIGHT(A1*100,2))>=50,(1-VALUE(RIGHT(A1*100,2)/100))+A1-0.1,(1-RIGHT(A1*100,2)/100)+A1-0.9)
 
thanks, but it's not working. For example, I have a value of $41.77 that I need to convert to $41.90 but it's giving me 17.67 as a result. I think there's something I'm missing. Here is what I converted it to on your suggestion: =IF(VALUE(RIGHT(F2,2))>=0.5,(1-RIGHT(F2,2))+F2-0.1,(1-RIGHT(F2,2))+F2-0.9)
 
I tried your last one and it's now giving me a result of $41.62, but I need to have either 41.90 (in this case) or 41.10 if the original cell value in f2 was 41.37 for example.

thanks
 
did you try the third one, it works for all scenarios on mine.

Blue
 
Sorry Man, I was not thinking - my values in cell F2 are compuyted and I forgot to round them to 2 decimals, thus the problem - thanks for all your help :)

I can't believe I Was being so stupid! I should be able to do this in my sleep!

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top