Range lookup problem

peterinaudo

New Member
Joined
Oct 4, 2012
Messages
25
Hi, I am having trouble working out this range lookup problem and would really appreciate some help. Still trying to get the hang of Excel.

I am using Excel 2007, my computer runs on Windows Vista.



Excel 2007
A
B
C
D
E
F
Initial Table
Price Range
Percentage
Price
Percentage
Price

<tbody>
[TD="align: center"]1
[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3
[/TD]

[TD="align: right"][/TD]

[TD="align: center"]4
[/TD]
[TD="align: right"] $ 0.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]25%
[/TD]
[TD="align: right"] $ 0.56
[/TD]

[TD="align: center"]5
[/TD]
[TD="align: right"] $ 0.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]50%
[/TD]
[TD="align: right"] $ 1.13
[/TD]

[TD="align: center"]6
[/TD]
[TD="align: right"] $ 0.60
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]75%
[/TD]
[TD="align: right"] $ 1.69
[/TD]

[TD="align: center"]7
[/TD]
[TD="align: right"] $ 0.80
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]100%
[/TD]
[TD="align: right"] $ 2.25
[/TD]

[TD="align: center"]8
[/TD]
[TD="align: right"] $ 1.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]125%
[/TD]
[TD="align: right"] $ 2.81
[/TD]

[TD="align: center"]9
[/TD]
[TD="align: right"] $ 1.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]150%
[/TD]
[TD="align: right"] $ 3.38
[/TD]

[TD="align: center"]10
[/TD]
[TD="align: right"] $ 1.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11
[/TD]
[TD="align: right"] $ 1.60
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12
[/TD]
[TD="align: right"] $ 1.80
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13
[/TD]
[TD="align: right"] $ 2.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14
[/TD]
[TD="align: right"] $ 2.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15
[/TD]
[TD="align: right"] $ 2.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16
[/TD]
[TD="align: right"] $ 2.60
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17
[/TD]
[TD="align: right"] $ 2.80
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]18
[/TD]
[TD="align: right"] $ 3.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19
[/TD]
[TD="align: right"] $ 3.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20
[/TD]
[TD="align: right"] $ 3.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1



What I would like to achieve-

1/ Cell C4 requires a function which will look at the value in A4, i.e. either the Range between $0.00 to $0.20 , OR $0.20 to $0.40, then search down the cells F4 to F9 and return the value in that Range only if there is one, otherwise return a blank.
2/ Cell B4 requires a function which will return the corresponding Percentage value of C4 if it is populated with a value, otherwise it is to remain blank.
3/ The function inserted in cell C4 will be copied down to cell C20.


Below is the desired result.


Excel 2007
A
B
C
D
E
F
Desired Result
Price Range
Percentage
Price
Percentage
Price

<tbody>
[TD="align: center"]1
[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3
[/TD]

[TD="align: right"][/TD]

[TD="align: center"]4
[/TD]
[TD="align: right"] $ 0.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]25%
[/TD]
[TD="align: right"] $ 0.56
[/TD]

[TD="align: center"]5
[/TD]
[TD="align: right"] $ 0.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]50%
[/TD]
[TD="align: right"] $ 1.13
[/TD]

[TD="align: center"]6
[/TD]
[TD="align: right"] $ 0.60
[/TD]
[TD="align: right"]25%
[/TD]
[TD="align: right"] $ 0.56
[/TD]
[TD="align: right"][/TD]
[TD="align: right"]75%
[/TD]
[TD="align: right"] $ 1.69
[/TD]

[TD="align: center"]7
[/TD]
[TD="align: right"] $ 0.80
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]100%
[/TD]
[TD="align: right"] $ 2.25
[/TD]

[TD="align: center"]8
[/TD]
[TD="align: right"] $ 1.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]125%
[/TD]
[TD="align: right"] $ 2.81
[/TD]

[TD="align: center"]9
[/TD]
[TD="align: right"] $ 1.20
[/TD]
[TD="align: right"]50%
[/TD]
[TD="align: right"] $ 1.13
[/TD]
[TD="align: right"][/TD]
[TD="align: right"]150%
[/TD]
[TD="align: right"] $ 3.38
[/TD]

[TD="align: center"]10
[/TD]
[TD="align: right"] $ 1.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11
[/TD]
[TD="align: right"] $ 1.60
[/TD]
[TD="align: right"]75%
[/TD]
[TD="align: right"] $ 1.69
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12
[/TD]
[TD="align: right"] $ 1.80
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13
[/TD]
[TD="align: right"] $ 2.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14
[/TD]
[TD="align: right"] $ 2.20
[/TD]
[TD="align: right"]100%
[/TD]
[TD="align: right"] $ 2.25
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15
[/TD]
[TD="align: right"] $ 2.40
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16
[/TD]
[TD="align: right"] $ 2.60
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17
[/TD]
[TD="align: right"] $ 2.80
[/TD]
[TD="align: right"]125%
[/TD]
[TD="align: right"] $ 2.81
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]18
[/TD]
[TD="align: right"] $ 3.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19
[/TD]
[TD="align: right"] $ 3.20
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20
[/TD]
[TD="align: right"] $ 3.40
[/TD]
[TD="align: right"]150%
[/TD]
[TD="align: right"] $ 3.38
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1


I hope this is easy for you to solve, thank you for your help.
regards, Pete
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,
given:

[TABLE="width: 520"]
<colgroup><col span="6"></colgroup><tbody>[TR]
[TD][/TD]
[TD]Desired Result[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Price Range[/TD]
[TD]Percentage[/TD]
[TD]Price[/TD]
[TD][/TD]
[TD]Percentage[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD] $0.20[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD]25%[/TD]
[TD] $0.56[/TD]
[/TR]
[TR]
[TD] $0.40[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD]50%[/TD]
[TD] $1.13[/TD]
[/TR]
[TR]
[TD] $0.60[/TD]
[TD]25%[/TD]
[TD] $0.56[/TD]
[TD][/TD]
[TD]75%[/TD]
[TD] $1.69[/TD]
[/TR]
[TR]
[TD] $0.80[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD]100%[/TD]
[TD] $2.25[/TD]
[/TR]
[TR]
[TD] $1.00[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD]125%[/TD]
[TD] $2.81[/TD]
[/TR]
[TR]
[TD] $1.20[/TD]
[TD]50%[/TD]
[TD] $1.13[/TD]
[TD][/TD]
[TD]150%[/TD]
[TD] $3.38[/TD]
[/TR]
[TR]
[TD] $1.40[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $1.60[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $1.80[/TD]
[TD]75%[/TD]
[TD] $1.69[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.00[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.20[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.40[/TD]
[TD]100%[/TD]
[TD] $2.25[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.60[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.80[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.00[/TD]
[TD]125%[/TD]
[TD] $2.81[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.20[/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.40[/TD]
[TD]150%[/TD]
[TD] $3.38[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In Cell B4 =IFERROR(IF(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1))=MEDIAN(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),A3:A4),INDEX($E$4:$E$9,MATCH(A4,$F$4:$F$9,1+1)),""),"") copied down till needed
In cell C4 =IFERROR(IF(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1))=MEDIAN(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),A3:A4),INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),""),"")

Note:
Column B formatted as percentage
Column C formatted as currency
Make sure that values in Column A and F are numbers formatted as currency and not a mix of text and integer.

Would that work for you?
 
Upvote 0
If you change your lookup table slightly, i.e. start with 0% $0.00, then you can avoid error handling

Drag B2:C2 Down

Excel Workbook
ABCDEF
3Price RangePercentagePricePercentagePrice
4$0.20  0%$0.00
5$0.4025%$0.56
6$0.6025%$0.5650%$1.13
7$0.8075%$1.69
8$1.00100%$2.25
9$1.2050%$1.13125%$2.81
10$1.40150%$3.38
11$1.6075%$1.69
12$1.80
13$2.00
14$2.20100%$2.25
15$2.40
16$2.60
17$2.80125%$2.81
18$3.00
19$3.20
20$3.40150%$3.38
Sheet1
 
Upvote 0
Hi,
given:

[TABLE="width: 520"]
<tbody>[TR]
[TD][/TD]
[TD]Desired Result
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Price Range
[/TD]
[TD]Percentage
[/TD]
[TD]Price
[/TD]
[TD][/TD]
[TD]Percentage
[/TD]
[TD]Price
[/TD]
[/TR]
[TR]
[TD] $0.20
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]25%
[/TD]
[TD] $0.56
[/TD]
[/TR]
[TR]
[TD] $0.40
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]50%
[/TD]
[TD] $1.13
[/TD]
[/TR]
[TR]
[TD] $0.60
[/TD]
[TD]25%
[/TD]
[TD] $0.56
[/TD]
[TD][/TD]
[TD]75%
[/TD]
[TD] $1.69
[/TD]
[/TR]
[TR]
[TD] $0.80
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]100%
[/TD]
[TD] $2.25
[/TD]
[/TR]
[TR]
[TD] $1.00
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]125%
[/TD]
[TD] $2.81
[/TD]
[/TR]
[TR]
[TD] $1.20
[/TD]
[TD]50%
[/TD]
[TD] $1.13
[/TD]
[TD][/TD]
[TD]150%
[/TD]
[TD] $3.38
[/TD]
[/TR]
[TR]
[TD] $1.40
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $1.60
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $1.80
[/TD]
[TD]75%
[/TD]
[TD] $1.69
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.00
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.20
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.40
[/TD]
[TD]100%
[/TD]
[TD] $2.25
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.60
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $2.80
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.00
[/TD]
[TD]125%
[/TD]
[TD] $2.81
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.20
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] $3.40
[/TD]
[TD]150%
[/TD]
[TD] $3.38
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In Cell B4 =IFERROR(IF(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1))=MEDIAN(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),A3:A4),INDEX($E$4:$E$9,MATCH(A4,$F$4:$F$9,1+1)),""),"") copied down till needed
In cell C4 =IFERROR(IF(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1))=MEDIAN(INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),A3:A4),INDEX($F$4:$F$9,MATCH(A4,$F$4:$F$9,1+1)),""),"")

Note:
Column B formatted as percentage
Column C formatted as currency
Make sure that values in Column A and F are numbers formatted as currency and not a mix of text and integer.

Would that work for you?


Hi cyrilbrd
thank you for working on this problem for me. Your solution works well for me and I really appreciate your efforts and the amazing speed of your response, I did get a little green error icon in the corner of the cells, but I dont think this is giving me any problem, although I did spend some time on the help screen trying to work it out. I am not very good with excel yet. I did get another response to this problem from Marcol who has thought of an interesting way of averaging the search range, I hadnt imagined showing the data like this so didnt ask for it in the original request, but now that I see it can be done I think it gives a better way to display the data for my purpose. Thank you so much!! Kind regards, Peter R
 
Upvote 0
Hi Marcol, I spent quite a bit of time (many many nights) trying to work out how to write a function to do this and also how to separate the range divisions. Your solution using averages is so much better than I could even imagine. Thank you for sharing your brilliance with me, I appreciate your help very much. Kind regards, Peter R
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top