Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the values from a list?

Does anyone have any suggestions on how to determine the values from a list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3, it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a list?
Thank for any suggestions
Eric


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default How to determine the values from a list?

try this for a start
C1=VLOOKUP($B$1-10,$A$1:$A$7,1)
C2=IF(VLOOKUP($B$1,$A$1:$A$7,1,1)=B1,VLOOKUP($B$1, $A$1:$A$7,1,1),"")
C3=VLOOKUP($B$1+10,$A$1:$A$7,1)
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"Eric" wrote:

Does anyone have any suggestions on how to determine the values from a list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3, it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a list?
Thank for any suggestions
Eric


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default How to determine the values from a list?

In C1:
=IF(COUNTIF(A1:A7,B1),INDEX(A1:A7,MATCH(LOOKUP(B1, A1:A7),A1:A7)-1),LOOKUP(B1,A1:A7))

In C2: =IF(ISNA(VLOOKUP(B1,A1:A7,1,0)),"",VLOOKUP(B1,A1:A 7,1,0))

In C3: =INDEX(A1:A7,MATCH(LOOKUP(B1,A1:A7),A1:A7)+1)


"Eric" wrote:

Does anyone have any suggestions on how to determine the values from a list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3, it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a list?
Thank for any suggestions
Eric


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default How to determine the values from a list?

Your formula in C1 is FAILED
If OP enter 35 in B1, the result of your formula returns 20, OP wants cell
C1 returns to 30

C1=VLOOKUP($B$1-10,$A$1:$A$7,1)


"John" wrote:

try this for a start
C1=VLOOKUP($B$1-10,$A$1:$A$7,1)
C2=IF(VLOOKUP($B$1,$A$1:$A$7,1,1)=B1,VLOOKUP($B$1, $A$1:$A$7,1,1),"")
C3=VLOOKUP($B$1+10,$A$1:$A$7,1)
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"Eric" wrote:

Does anyone have any suggestions on how to determine the values from a list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3, it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a list?
Thank for any suggestions
Eric


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default How to determine the values from a list?

I put an extra zero in by mistake - try C1=VLOOKUP($B$1-1,$A$1:$A$7,1)
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"Teethless mama" wrote:

Your formula in C1 is FAILED
If OP enter 35 in B1, the result of your formula returns 20, OP wants cell
C1 returns to 30

C1=VLOOKUP($B$1-10,$A$1:$A$7,1)


"John" wrote:

try this for a start
C1=VLOOKUP($B$1-10,$A$1:$A$7,1)
C2=IF(VLOOKUP($B$1,$A$1:$A$7,1,1)=B1,VLOOKUP($B$1, $A$1:$A$7,1,1),"")
C3=VLOOKUP($B$1+10,$A$1:$A$7,1)
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"Eric" wrote:

Does anyone have any suggestions on how to determine the values from a list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3, it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a list?
Thank for any suggestions
Eric




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to determine the values from a list?

What should happen if/when the lookup number is less than the lowest number
in the list? What should happen if/when the lookup number is greater than
the highest number in the list? What if the lookup number equals the lowest
number in the list? What if the lookup number equals the highest number in
the list?

Biff

"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the values from a
list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3,
it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given
one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a
list?
Thank for any suggestions
Eric




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to determine the values from a list?

Although the OP didn't define what to do in all cases (see my other reply)
the formula in C1 could fail and the formula in C3 could fail. If the lookup
number was 70 the formula in C3 will return a #REF! error.

In C2: =IF(ISNA(VLOOKUP(B1,A1:A7,1,0)),"",VLOOKUP(B1,A1:A 7,1,0))


Why do a double lookup?

=IF(COUNTIF(A1:A7,B1),B1,"")

Biff

"Teethless mama" wrote in message
...
In C1:
=IF(COUNTIF(A1:A7,B1),INDEX(A1:A7,MATCH(LOOKUP(B1, A1:A7),A1:A7)-1),LOOKUP(B1,A1:A7))

In C2: =IF(ISNA(VLOOKUP(B1,A1:A7,1,0)),"",VLOOKUP(B1,A1:A 7,1,0))

In C3: =INDEX(A1:A7,MATCH(LOOKUP(B1,A1:A7),A1:A7)+1)


"Eric" wrote:

Does anyone have any suggestions on how to determine the values from a
list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3,
it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given
one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a
list?
Thank for any suggestions
Eric




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the values from a list?

Thank everyone very mcuh for suggestions
I will set the 999999 as the highest number in the list, and set 0 as the
lowest number. Therefore the given number in cell B1 must be within this
range.
Thank everyone very much
Eric

"T. Valko" wrote:

What should happen if/when the lookup number is less than the lowest number
in the list? What should happen if/when the lookup number is greater than
the highest number in the list? What if the lookup number equals the lowest
number in the list? What if the lookup number equals the highest number in
the list?

Biff

"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the values from a
list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell C3,
it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given
one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a
list?
Thank for any suggestions
Eric





  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to determine the values from a list?

the given number in cell B1 must be within this range.

You might want to set data validation on cell B1 to ensure the correct value
is entered.

Select cell B1
Goto the menu DataValidation
Allow: Custom
Formula: =AND(B1A1,B1<A7)
OK out

Formulas:

C1: =LOOKUP(B1,A1:A7,A1:A7)
C2: =IF(COUNTIF(A1:A7,B1),B1,"")
C3: =IF(B1=0,0,INDEX(A1:A7,MATCH(LOOKUP(B1,A1:A7),A1:A 7)+1))

Biff

"Eric" wrote in message
...
Thank everyone very mcuh for suggestions
I will set the 999999 as the highest number in the list, and set 0 as the
lowest number. Therefore the given number in cell B1 must be within this
range.
Thank everyone very much
Eric

"T. Valko" wrote:

What should happen if/when the lookup number is less than the lowest
number
in the list? What should happen if/when the lookup number is greater than
the highest number in the list? What if the lookup number equals the
lowest
number in the list? What if the lookup number equals the highest number
in
the list?

Biff

"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the values from a
list?
such as following example

Under column A
There are some values listed from cell A1 to A7
10,20,30,40,50,60,70

In cell B1, there is a given value 35, I need to determine the upper
and
lower values based on the given one.
In cell C1, it returns 30 and in cell C3, it returns 40.

If the given value from B1 is 40, then
In cell C1, it returns 30, and in cell C2, it returns 40 and in cell
C3,
it
returns 50.

For the cell C1, it displays the lower value based on the given one.
For the cell C2, it displays the given value if it equals to the given
one,
else display nothing.
For the cell C3, it displays the upper value based on the given one.

Does anyone have any suggestions on how to determine the values from a
list?
Thank for any suggestions
Eric







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
How to determine the values from a list? Eric Excel Worksheet Functions 7 March 30th 07 06:34 AM
How to determine the values from a list? Eric Excel Discussion (Misc queries) 9 March 24th 07 01:59 PM
How to determine the values from a list? Eric Excel Worksheet Functions 1 March 23rd 07 05:26 AM
How to determine geometric mean of 152 values? Jerry G Excel Worksheet Functions 2 June 20th 06 08:52 PM
List ? - How do I make information in one cell determine list to u Brad_A Excel Worksheet Functions 1 January 18th 05 04:10 PM


All times are GMT +1. The time now is 12:14 AM.

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"