wilkisa
Well-known Member
- Joined
- Apr 7, 2002
- Messages
- 657
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
I've been struggling with this one and I don't think it should be so difficult. My user is rather old school and wants to show his stock prices round to the nearest half cent and then display that half as a fraction. Example: 10.165 should be displayed as 10.16 1/2 or 4.555 should be displayed as 4.55 1/2.
I've tried the DOLLARFR function but it wants to display the entire decimal as a fraction. I tried custom formatting the cells as using various combinations of # ?/? trying to get it to display only the half cent in fractional format but haven't been successful. I then hit on the following formula:
=IF(RIGHT(B18,1)="5",SUBSTITUTE(B18,RIGHT(B18,1)," 1/2"),B18)
and it works great...as long as there is only a single 5 in the value to convert. The value above, 4.555, displays as 4. 1/2 1/2 1/2. So, I clearly need help with this. Does someone have a good solution?
Thanks,
Shirlene
I've tried the DOLLARFR function but it wants to display the entire decimal as a fraction. I tried custom formatting the cells as using various combinations of # ?/? trying to get it to display only the half cent in fractional format but haven't been successful. I then hit on the following formula:
=IF(RIGHT(B18,1)="5",SUBSTITUTE(B18,RIGHT(B18,1)," 1/2"),B18)
and it works great...as long as there is only a single 5 in the value to convert. The value above, 4.555, displays as 4. 1/2 1/2 1/2. So, I clearly need help with this. Does someone have a good solution?
Thanks,
Shirlene