Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
A rounding oddity
To help answer a question on this group, I wanted to convert the decimal
part of a number (in the set 1, 1.1, 1.2, ...... 9.7, 9.8, 9.9 ) to a letter. Thus 2.1 would yield a, 2.2 would give b. I experimented with =CHOOSE(MOD(A1,1)*10+1,"z","a","b","c","d","e","f" ,"g","h","i") but it did not quite work (for example 3.8 gave 'g' and not 'h') So I tried =CHOOSE(MOD(A1*10,10)+1,"z","a","b","c","d","e","f ","g","h","i") and this worked. Odd since, at the integer level, =MOD(A1,1)*10+1 and =MOD(A1*10,10)+1 give the same result. Using the Evaluate Formula tool (I work with XL 2003) I was unable to see why my original formula did not work. =CHOOSE(MOD(3.8,1)*10+1,"z","a","b","c","d","e","f ","g","h","i") yields =CHOOSE(9,"z","a","b","c","d","e","f","g","h","i") but the next result is g not h Very odd!!! Happy New Year to all -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rounding | Excel Discussion (Misc queries) | |||
How do I correct rounding errors in Excel formulas? | Excel Worksheet Functions | |||
Rounding to the Nearest Eighth | Excel Discussion (Misc queries) | |||
Rounding | Excel Discussion (Misc queries) | |||
Banker's Rounding - need help! | Excel Discussion (Misc queries) |