right

G

Guest

Hello,

Is it possible to tell what the right 3 characters in a
formula are

I am familiar with =Right(a1,3)

but how do I get this to work with the formula in the cell
not the value that ends up in the cell
 
T

Tom Ogilvy

builtin worksheetfunctions can't work with the formula in a cell. You would
need to write a UDF in VBA.
 
F

Frank Kabel

Hi Tom
though I wouldn't use the following approach (and would prefer a VBA
solution) it is possible without VBA :)


So just for the fun of it the OP may try the following:
- lets assume you are on sheet1
- your formula is in cell A1

Try the following:
- select cell B1
- goto 'Insert - Name - Define'
- use the name 'formula' for example and as 'refert to' enter the
following formula:
=GET.CELL(6,sheet1!A1)

Now enter in cell B1:
=Right(formula,3)
 
T

Tom Ogilvy

Now copy the cell with the formula and paste it on another sheet. In xl2000
and earlier, you get a message box and when clicked, a general protection
fault, excel closes and all changes are lost. I think xl2002 is more
resiliant,..
 
F

Frank Kabel

Hi Tom
I know :)
this is why I wouldn't recommend this usage (sorry, forgot to add the
explanation for it). And you're right. At least Excel 2003 has no
problems with copying this formula.
 
Top