RIGHT

P

PeterM

Is there a way in Excel 2003 to build the following formula WITHOUT using "'s
(double quotes)?

=RIGHT("12345 description for code 12345",LEN("12345 description for code
12345")-FIND(chr(32),"12345 description for code 12345",1))

I've tried replacing the double quotes with chr(34)& like the example below,
but Excel doesn't like it...

=RIGHT(chr(34)& 12345 description for code 12345 &chr(34),LEN(chr(34)& 12345
description for code 12345 &chr(34))-FIND(chr(32),chr(34)& 12345 description
for code 12345 &chr(34),1))

thanks in advance for your help
 
N

Niek Otten

Hi Peter,

Enter "12345 description for code 12345" (without the quotes) in a cell.
=RIGHT(A1,LEN(A1)-FIND(CHAR(32),A1,1))

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| Is there a way in Excel 2003 to build the following formula WITHOUT using "'s
| (double quotes)?
|
| =RIGHT("12345 description for code 12345",LEN("12345 description for code
| 12345")-FIND(chr(32),"12345 description for code 12345",1))
|
| I've tried replacing the double quotes with chr(34)& like the example below,
| but Excel doesn't like it...
|
| =RIGHT(chr(34)& 12345 description for code 12345 &chr(34),LEN(chr(34)& 12345
| description for code 12345 &chr(34))-FIND(chr(32),chr(34)& 12345 description
| for code 12345 &chr(34),1))
|
| thanks in advance for your help
 
P

PCLIVE

What is the purpose of what you are trying to achieve? If you don't want to
use the double-quotes at all, then place your text string in a cell and
reference the cell.

=RIGHT(A1,LEN(A1)-FIND(CHAR(32),A1,1))

Regards,
Paul
 
T

T. Valko

chr() is not worksheet function.

Why don't you put the string in a cell then:

=MID(A1,FIND(" ",A1)+1,255)
 
P

PeterM

I know it sounds goofy, but I'm building a spreadsheet from a database system
and the database query only recognizes a double quote as a delimiter. So if
I want to create a column containing the department code/name for each
employee, I need to embed the department code/name into the formula, because
I can't have variables in the database query. The sample table below is:

emp department code/name
------------ ----------------------------
001 1a3dk Process Manager
003 2Kdk3 Area Manager, Special Projects
1333 93kd9 Shift Supervisor

I need to populate the cell in the spreadsheet with the name of the
department only, not the code...so my query looks like

sql select emp, "=RIGHT(chr(34)& [database value for department code/name]
&chr(34),LEN(chr(34)& [database value for department code/name]
&chr(34))-FIND(chr(32),chr(34)& [database value for department code/name]
&chr(34),1))" from............

as each row is built by the query the department code/name is inserted into
the =RIGHT statement...

using the first row in the sample above, the resulting query would produce
the spreadsheet with the following in each column:
col1 col2
-------- ---------------------
001 1a3dk Process Manager
003 2Kdk3 Area Manager, Special Projects
1333 93kd9 Shift Supervisor

=RIGHT(chr(34)& 001 1a3dk Process Manager &chr(34),LEN(chr(34)& 001 1a3dk
Process Manager &chr(34))-FIND(chr(32),chr(34)& 001 1a3dk Process Manager
&chr(34),1))
field99 and so on and so on

and once the spreadsheet is opened, it will recognize the =RIGHT as a
formula and Process Manager would appear in the col2

I know this is very confusing, but trust me, I need to embed the value I'm
performing the =RIGHT function on in the formula and cannot reference a
cell...

thanks in advance for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top