Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default referencing a cell

I have the following table

A B C
1 From To Amount
2 0 10 10
3 11 20 30
4 21 50 40

I would like to enter a value in D1 Cell -- 34
What is the formula that is going to return 40 because 34 is in between 21
and 50?

Thanks so much


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default referencing a cell

This works just for your typed example.

=IF(AND(D1A1,D1<B1),40)

If you want to cover the 3 amounts you've listed, the try this.

=IF(AND($D$1$A2,$D$1<$B2),C4,IF(AND($D$1$A3,$D$1 <$B3),C3,IF(AND($D$1$A4,$D$1<B4),C2)))

Now your question actually states "between" the two numbers. If you want to
include the two numbers in your formula, then:

=IF(AND($D$1=$A2,$D$1<=$B2),$C2,IF(AND($D$1=$A3, $D$1<=$B3),C3,IF(AND($D$1=$A4,$D$1<=B4),C4)))

HTH,
Paul




"MIchel Khennafi" wrote in message
...
I have the following table

A B C
1 From To Amount
2 0 10 10
3 11 20 30
4 21 50 40

I would like to enter a value in D1 Cell -- 34
What is the formula that is going to return 40 because 34 is in between 21
and 50?

Thanks so much



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default referencing a cell

Try something like this:

Using your example data in A1:C4
E1: =VLOOKUP(D1,A2:C4,3,1)

See Debra Dalgleish's website for information on the VLOOKUP function:
http://www.contextures.com/xlFunctions02.html

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"MIchel Khennafi" wrote:

I have the following table

A B C
1 From To Amount
2 0 10 10
3 11 20 30
4 21 50 40

I would like to enter a value in D1 Cell -- 34
What is the formula that is going to return 40 because 34 is in between 21
and 50?

Thanks so much



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 65
Default referencing a cell

Ron,

That appears to work unless the lookup number is over 50. They didn't
really state what they wanted to happen in that situation, but the result
continues to be 40.
I'm sure an If statement could be added to avoid that. I like your solution
better than my though.

"Ron Coderre" wrote in message
...
Try something like this:

Using your example data in A1:C4
E1: =VLOOKUP(D1,A2:C4,3,1)

See Debra Dalgleish's website for information on the VLOOKUP function:
http://www.contextures.com/xlFunctions02.html

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"MIchel Khennafi" wrote:

I have the following table

A B C
1 From To Amount
2 0 10 10
3 11 20 30
4 21 50 40

I would like to enter a value in D1 Cell -- 34
What is the formula that is going to return 40 because 34 is in between
21
and 50?

Thanks so much





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
Referencing a cell based on the value in another cell septillion Excel Discussion (Misc queries) 3 June 30th 06 03:03 AM
Cell Referencing? Andy Excel Worksheet Functions 0 June 26th 06 03:07 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
resetting last cell jagdish.eashwar Excel Discussion (Misc queries) 11 March 31st 06 02:06 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 10:00 AM.

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"