Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TheRobsterUK
 
Posts: n/a
Default Return entry in column above/below cell


Hi,

I need to find a way of returning the cell values that are directly
above and below a specific cell. For example, suppose I have the
following list in column A:

dogs
cats
fish
mice

There is another cell (say cell B1) in which the user inputs one of the
items in the list and then another 2 cells (say B2 and B3) that return
the entries above and below the user-input entry i.e. in this case, the
user input "cats" and so in cell B2 would be displayed "dogs" and in
cell B3 "fish".

I cannot get this to work however. I have tried several functions (e.g.
HLOOKUP) but it does not work as intended. Can anyone give me any
help/advice?

Many thanks
-Rob


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=485713

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Return entry in column above/below cell

Try this:

With your list of animals is in Column A (no repeats) beginning in A2
A1: Animals
A2 through A???: List of animals

B1: (User inputs an animal)
or...even better
Select B1
DataData Validation
\Allow: List
\Source: A2: (end of your list)

For item before selection:
B2: =INDEX(A:A,MATCH(B1,A:A,0)-1,1)

For item after selection:
B3: =INDEX(A:A,MATCH(B1,A:A,0)+1,1)

Does that help?

€¢€¢€¢€¢€¢€¢€¢€¢€¢€¢
Regards,
Ron


"TheRobsterUK" wrote:


Hi,

I need to find a way of returning the cell values that are directly
above and below a specific cell. For example, suppose I have the
following list in column A:

dogs
cats
fish
mice

There is another cell (say cell B1) in which the user inputs one of the
items in the list and then another 2 cells (say B2 and B3) that return
the entries above and below the user-input entry i.e. in this case, the
user input "cats" and so in cell B2 would be displayed "dogs" and in
cell B3 "fish".

I cannot get this to work however. I have tried several functions (e.g.
HLOOKUP) but it does not work as intended. Can anyone give me any
help/advice?

Many thanks
-Rob


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=485713


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TheRobsterUK
 
Posts: n/a
Default Return entry in column above/below cell


Hi Ron,

Yes I got it working with some slight adaptations to your suggestion.
Many thanks for the response. :)

-Rob


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=485713

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
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Copy one cell to entire column Tom Excel Discussion (Misc queries) 6 April 27th 05 11:39 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Syntax for inferred cell references donesquire Excel Worksheet Functions 4 April 4th 05 09:29 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:50 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"