How to do vlookup on table where value is instrumental? See details.

dmadhup

Board Regular
Joined
Feb 21, 2018
Messages
146
Office Version
  1. 365
Hi,

I want to do VLOOKUP on sheet1 to Sheet2 and get Price. But I want to see the result as show in sheet1. Saying that, VLOOKUP will pick the data where there is incremental.
This formula doesn't meet my requirements.
=VLOOKUP(A3,Sheet2!A:B,2,FALSE)

Any idea to achieve the goal?


1596771357070.png
1596771383488.png
 
Actually I want to get char from sheet2 when transition from
1 to 2 for level 1
2 to 3 for level 2
3 to 4 for level 3

like that....
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Actually I want to get char from sheet2 when transition from
1 to 2 for level 1
2 to 3 for level 2
3 to 4 for level 3

like that....
I don't understand that. Could we have sample data and expected results with XL2BB?
 
Upvote 0
Hi Peter,
I am trying to use XL2BB.
Meanwhile, i am trying to elaborate it.

here in sheet1 the green color M should be D. Because in Sheet2 D is the position where level goes from 1 to 2

1596778007722.png
1596778049896.png
 
Upvote 0
SHEET1.xlsx
AB
7LevelChar
80A
91B
101C
111D
122E
132F
142G
152H
162I
173J
183K
194L
201M
211M
221M
Sheet2
 
Upvote 0
SHEET1.xlsx
ABC
1LevelChar
20A
31MShould D here at B3 cell
42I
53K
6
Sheet1
Cell Formulas
RangeFormula
B2:B5B2=LOOKUP(REPT("Z",255),FILTER(Sheet2!B$2:B$20,Sheet2!A$2:A$20=A2))
 
Upvote 0
Here is the sample result

SHEET1.xlsx
ABC
1LevelChar
20A
31D
42I
53K
6
Sheet1
Cell Formulas
RangeFormula
B2,B4:B5B2=LOOKUP(REPT("Z",255),FILTER(Sheet2!B$2:B$20,Sheet2!A$2:A$20=A2))
 
Upvote 0
Thanks for getting XL2BB going. (y)

Looking at post 14: This is different to what you had before where all the values in Sheet2 were ascending down the page.
In Sheet2, is there or will there ever be more data below row 22 as shown?
What I am getting at is I can see that 1 changes to 2 from row 11 to 12 but 1 appears again in rows 20:22. Suppose row 23 is 2 then we have 1 changing to 2 at rows 11/12 and rows 22/23.
In that case, how would we determine what to return in Sheet1?
 
Upvote 0
Hi Peter,
Thank you for response.
Yes, I added more rows to test because there could be more 1s and 2s too. But we pick the first appearance of transition from 1 to 2 or 2 to 3.
 
Upvote 0
we pick the first appearance of transition from 1 to 2 or 2 to 3.
OK, see if this is better

dmadhup 2020-08-07 1.xlsm
AB
1LevelPrice
20A
31B
41C
51D
62E
72F
82G
92H
102I
113J
123K
134L
141M
151M
161M
172N
183O
193O
203O
213O
224P
231Q
24
Sheet2



dmadhup 2020-08-07 1.xlsm
AB
1
20A
31D
42I
53K
64L
Sheet1
Cell Formulas
RangeFormula
B2:B6B2=INDEX(FILTER(Sheet2!B$2:B$30,(Sheet2!A$2:A$30=A2)*(Sheet2!A$3:A$31<>A2)),1)
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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