OpenOffice Calc function question

  • Follow


Anybody good at OOCalc or maybe Excel?

This works, and gives the right answer ("W$2"):
=ADDRESS(2;23;2)

This works, and gives the right answer (the contents of W2, currently 87):
=CELL("contents"; W$2)

This gives a "#REF!" error:
=CELL("contents"; ADDRESS(2;23;2))

What's wrong?  How can I get the contents of (computed, not hardcoded)
W2?

-- 
-eben      QebWenE01R@vTerYizUonI.nOetP      royalty.mine.nu:81
      A neutron walks into a bar; he asks the bartender,
     "How much for a beer?"  The bartender looks at him,
    and says "For you, no charge." -- GooberMcFly on Fark
0
Reply ebenZEROONE (419) 12/14/2008 1:11:18 AM

Hactar <ebenZEROONE@verizon.net> wrote:
> Anybody good at OOCalc or maybe Excel?
> 
> This works, and gives the right answer ("W$2"):
> =ADDRESS(2;23;2)
> 
> This works, and gives the right answer (the contents of W2, currently 87):
> =CELL("contents"; W$2)
> 
> This gives a "#REF!" error:
> =CELL("contents"; ADDRESS(2;23;2))
> 
> What's wrong?

CELL()'s second argument should be a reference, ADDRESS() returns a
text string.  The non-working version is equivalent to (note the quotes):

  =CELL("contents"; "W$2")

> How can I get the contents of (computed, not hardcoded)
> W2?

Use INDIRECT():

  =CELL("contents"; INDIRECT(ADDRESS(2;23;2)))
0
Reply news0021 (22) 12/14/2008 4:17:05 PM


In article <15of16xa23.ln2@perseus.gibson-hrd.abelgratis.co.uk>,
Dave Gibson <dave+news002@gibson-hrd.abelgratis.co.uk.invalid> wrote:
> Hactar <ebenZEROONE@verizon.net> wrote:
> > Anybody good at OOCalc or maybe Excel?
> > 
> > This works, and gives the right answer ("W$2"):
> > =ADDRESS(2;23;2)
> > 
> > This works, and gives the right answer (the contents of W2, currently 87):
> > =CELL("contents"; W$2)
> > 
> > This gives a "#REF!" error:
> > =CELL("contents"; ADDRESS(2;23;2))
> > 
> > What's wrong?
> 
> CELL()'s second argument should be a reference, ADDRESS() returns a
> text string.  The non-working version is equivalent to (note the quotes):
> 
>   =CELL("contents"; "W$2")
> 
> > How can I get the contents of (computed, not hardcoded)
> > W2?
> 
> Use INDIRECT():
> 
>   =CELL("contents"; INDIRECT(ADDRESS(2;23;2)))

Excellent, that works.  Thanks.

-- 
-eben      QebWenE01R@vTerYizUonI.nOetP      http://royalty.mine.nu:81
GEMINI:  Your birthday party will be ruined once again by your explosive
flatulence. Your love life will run into trouble when your fiancee hurls
a javelin through your chest.  -- Weird Al, _Your Horoscope for Today_
0
Reply ebenZEROONE (419) 12/14/2008 6:58:33 PM

2 Replies
31 Views

(page loaded in 0.095 seconds)

Similiar Articles:







7/20/2012 12:01:46 AM


Reply: