Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how do I create a cell reference from ADDRESS function return?

I am using the RAND function to generate a row number from which I want to
extract the contents of the cell at a specific column at that row. I have
used the ADDRESS function to create a text string that is the cell reference.
I am trying to use the CELL function with the "contents" info type but I
can't figure out how to use the cell reference I have created to direct the
function to the cell to get the contents.

=ROUND((RAND()*(COUNTIF(A:A, "<"))-1),0) (places an integer number in cell
F2)
=ADDRESS(F2,1) (Returns the text string for the Cell in column A, row
defined as number generated and placed in F2)

=CELL("contents", ???) When I try to use the reference to the cell that the
text string is in from the ADDRESS function, I get the text string back.
When I nest Cell functions, I get an error.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default how do I create a cell reference from ADDRESS function return?

Try

=CELL("contents",INDIRECT(F3))

--
__________________________________
HTH

Bob

"Coachdenny" wrote in message
...
I am using the RAND function to generate a row number from which I want to
extract the contents of the cell at a specific column at that row. I have
used the ADDRESS function to create a text string that is the cell
reference.
I am trying to use the CELL function with the "contents" info type but I
can't figure out how to use the cell reference I have created to direct
the
function to the cell to get the contents.

=ROUND((RAND()*(COUNTIF(A:A, "<"))-1),0) (places an integer number in
cell
F2)
=ADDRESS(F2,1) (Returns the text string for the Cell in column A, row
defined as number generated and placed in F2)

=CELL("contents", ???) When I try to use the reference to the cell that
the
text string is in from the ADDRESS function, I get the text string back.
When I nest Cell functions, I get an error.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default how do I create a cell reference from ADDRESS function return?

Hi,

If you want a random whole number for a cell address you don't need to

=ROUND((RAND()*(COUNTIF(A:A, "<"))-1),0)

Why not

=RAND()*COUNTIF(A:A, "<")+1

=RANDBETWEEN(1,COUNTA(A:A))

None of these formula guarentee unique results.

If this helps, please click the Yes botton

Cheers,
Shane Devenshire

"Coachdenny" wrote:

I am using the RAND function to generate a row number from which I want to
extract the contents of the cell at a specific column at that row. I have
used the ADDRESS function to create a text string that is the cell reference.
I am trying to use the CELL function with the "contents" info type but I
can't figure out how to use the cell reference I have created to direct the
function to the cell to get the contents.

=ROUND((RAND()*(COUNTIF(A:A, "<"))-1),0) (places an integer number in cell
F2)
=ADDRESS(F2,1) (Returns the text string for the Cell in column A, row
defined as number generated and placed in F2)

=CELL("contents", ???) When I try to use the reference to the cell that the
text string is in from the ADDRESS function, I get the text string back.
When I nest Cell functions, I get an error.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default how do I create a cell reference from ADDRESS function return?

First off, your first formula (the one with RAND in it) can result in the
values 0 and -1 which would make bad row numbers. That aside, what would be
wrong with using this formula instead of the CELL one...

=INDEX(A:A,F2)

where you would use whatever column reference you wanted to look up the
value in?

--
Rick (MVP - Excel)


"Coachdenny" wrote in message
...
I am using the RAND function to generate a row number from which I want to
extract the contents of the cell at a specific column at that row. I have
used the ADDRESS function to create a text string that is the cell
reference.
I am trying to use the CELL function with the "contents" info type but I
can't figure out how to use the cell reference I have created to direct
the
function to the cell to get the contents.

=ROUND((RAND()*(COUNTIF(A:A, "<"))-1),0) (places an integer number in
cell
F2)
=ADDRESS(F2,1) (Returns the text string for the Cell in column A, row
defined as number generated and placed in F2)

=CELL("contents", ???) When I try to use the reference to the cell that
the
text string is in from the ADDRESS function, I get the text string back.
When I nest Cell functions, I get an error.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
function to find value and return cell reference rcc Excel Discussion (Misc queries) 6 June 27th 12 02:55 AM
Create a database query that does not reference an IP address. Brady Excel Discussion (Misc queries) 0 July 12th 07 07:13 PM
How do I create a cell reference to return name of the tab? pameluh Excel Discussion (Misc queries) 4 September 19th 06 12:24 AM
How do I use a function to return the address of a cell? ren6175 Excel Worksheet Functions 6 April 21st 05 03:13 PM
Using result from ADDRESS function as a cell reference itself LShutzberg Excel Worksheet Functions 3 December 12th 04 11:18 AM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"