View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Pontus Pontus is offline
external usenet poster
 
Posts: 15
Default Getting cell index from cell to the right

Okey to elaborate (this is gonna be a long one =P).

I'm trying to make my work of sorting a column of articles easier. Lets say
I have a column where every cell contains one article, e.g.

A B
1 Chair
2 Table
3 Apple
4 Sofa
5 Pasta


What I would like to do is to have a formula that I can copy into cell A1
and then drag down so that the cells in column A gives instead a name of a
group that the article in column B belongs to. The answer I want could for
instance be:


A B
1 Furniture Chair
2 Furniture Table
3 Food Apple
4 Furniture Sofa
5 Food Pasta

Hitherto I have managed to write the code that recognizes a word and gives
back the name of the group. My only problem now is that I somehow need to
refer to the cell that is possitioned to the right of the cell where I
copy-paste my code. This has to be done without going into the code and
change manually since the code is kind of massive. I want other persons to be
able to use this that do not know which variables to change.

If anybody has the answer how to do this it would be really great

thanx
Pontus

"Ragdyer" wrote:

Would you care to elaborate on what you intend to do with that address of
the cell on the right?

The reason I'm asking, is because you can use a "relative" named formula
that can return the *contents* of that cell to the right of which ever cell
you enter it into.

Would that be of interest to you?
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Pontus" wrote in message
...
Hmm, I'll try to explain better.

What I want to do is to have a formula that I can copy in to any cell

which
will give the cell index of the cell to the right.

Exampel:
If I copy my formula in to cell K23 I want the answer to be L23 or
If I copy my formula in to cell B23 I want the answer to be C23 etc.

Hope I made myself more clear now =)

Thanks for answering.
Pontus

"JMay" wrote:

Do you mean:
A1 =Offset($B1,0,1)
B1 = Sum(A2:A4)
C1 = whatever

"Pontus" wrote:

Hi,

I want to have a formula that retrievs the index from the cell to the

right
of the cell with the formula.

I know that the formula below gives the index of the cell you are in

but
that doesn't help me much unfortunately. Is there a simplier way or

maybe a
way that utilises this code?

=SUBSTITUTE(SUBSTITUTE(CELL("address");"$";"");ROW ();"")

Best Regards
Pontus