Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
aschmitz
 
Posts: n/a
Default Do I need to use a Query


I have a data base of thirty rows. I need to be able to access any one
of these rows depending on the input number. eg If the input is 1, I
need to access row 17...if the input is 2, I need to access row 18 and
so on.
How can I accomplish this without using thirty IF-Then statements.

I was told that I needed to use a Query but do not know how.

Any help would be appreciated

aschmitz


--
aschmitz
------------------------------------------------------------------------
aschmitz's Profile: http://www.excelforum.com/member.php...o&userid=32239
View this thread: http://www.excelforum.com/showthread...hreadid=525981

  #2   Report Post  
Posted to microsoft.public.excel.misc
CaptainQuattro
 
Posts: n/a
Default Do I need to use a Query


There are several functions you can use in this situation. One I like
to use is the Offset statement.

=offset(HomeCell,Row Offset,Column Offset)


In your example, assuming the database is contained in cells A17 to
Z47, you would set cell $A$16 as your home cell. =Offset($A$16,0,0)
would then
return the contents of cell A16

=Offset($A$16,1,0) returns the contents of cell A17
=Offset($A$16,1,1) returns the contents of cell B17
=Offset($A$16,2,1) returns the contents of cell A18

Now If you set cell A1 as your input cell, you can substitute $A$1 for
the number after the first comma. When you enter a number into Cell
$A$1, the formula will look up a value in the desired row of your
database.


--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=525981

  #3   Report Post  
Posted to microsoft.public.excel.misc
aschmitz
 
Posts: n/a
Default Do I need to use a Query


Captain Quattro,

Thanks for the help. That worked out very nicely!!!



aschmitz


--
aschmitz
------------------------------------------------------------------------
aschmitz's Profile: http://www.excelforum.com/member.php...o&userid=32239
View this thread: http://www.excelforum.com/showthread...hreadid=525981

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
changing query source [email protected] Excel Worksheet Functions 2 March 21st 06 08:55 PM
enable automatic refresh Vass Excel Worksheet Functions 2 March 11th 06 04:36 AM
AHHH! Again JAA149 Excel Discussion (Misc queries) 0 October 31st 05 11:36 AM
"Query cannot be edited by the Query Wizard" PancakeBatter Excel Discussion (Misc queries) 0 April 25th 05 05:59 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 03:27 PM.

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

About Us

"It's about Microsoft Excel"