Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
RIGHT function doesn't read 0's
If I use RIGHT,2 on a cell with the value 30.00, it's output is 3, not
0. What's going on here? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
RIGHT function doesn't read 0's
Hi,
If the cell is formatted a number with 2 decomal places then the output of =RIGHT(A1,2) Should be 30 The reason can be seen if you select the cell and look in the formula bar, the .00 bit is a format that you see but the real content og the cell is 30. Enter 30.01 and the same formula will output 01 because now the .01 bit is 'real' and not a format. Mike "nikita" wrote: If I use RIGHT,2 on a cell with the value 30.00, it's output is 3, not 0. What's going on here? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
RIGHT function doesn't read 0's
"nikita" wrote:
If I use RIGHT,2 on a cell with the value 30.00, it's output is 3, not 0. Use RIGHT(TEXT(A1,"0.00"),2). What's going on here? With RIGHT(A1,2), if A1 is a numeric, it is really difficult to know what you will get. For example, put 1E-16 into A1 and look RIGHT(A1,2). Then put 1E-28 into A1. It seems that in that form, the RIGHT result depends on how the numeric value appears in the Formula Bar; and that is unspecified, AFAIK. (Although we might be able to reverse-engineer the rules. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
RIGHT function doesn't read 0's
what the cell contains and what you see depends upon whatever formattign you
have, when you use a STRING function on a cell containiong a number you'll get these 'strange' results fro example , type 30 into any unformatted cell, then format to 2 dps. Nowin the immediate window type ?right(selection.text,5) I get 0.00 whe I'd have expected to see 30.00 ... there's a trailing space. so specifically format numbers before you test them with string functions is the rule! "nikita" wrote: If I use RIGHT,2 on a cell with the value 30.00, it's output is 3, not 0. What's going on here? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Read specific time in NOW() function | Excel Worksheet Functions | |||
Read Matrix via function | Excel Programming | |||
read next two cells over using Large function | Excel Programming | |||
<REQ Can anyone help me build a function, please read.... | Excel Worksheet Functions | |||
How this function is read? | Excel Programming |