View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default How to use Index?

On Thu, 4 Oct 2007 17:52:01 -0700, Eric wrote:

Does anyone have any suggestions on how to locate a value from a list?
The given list of numbers under column A
1,3,5,7,11,13,17,19,23
If I enter an integer 15 in cell B2, then it will return 17 in cell B1 and
13 in cell B3.
If I enter an integer 13 in cell B2, then it will return 13 in cell B1 and
13 in cell B3, since the list contains the number of 13
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric


B1: =INDEX(A1:A9,MATCH(B2,A1:A9,1))
B3: =INDEX(A1:A9,MATCH(B2,A1:A9,1)+1*(COUNTIF(A1:A9,B2 )<1))


--ron