Vlookup Index Based On Level Number Criteria

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all...

how to make vlookup index based on level number criteria:
"Good" in cell C11 as basis
vlookup compare.xlsx
BCDEFGHIJKLM
3datacriterianumber of levelindex1index2
4Orange JuiceVery good10%0%
5Orange JuiceGood22%-2%
6Orange JuiceEnough34%-4%
7Orange JuiceBad46%-6%
8Orange JuiceWorst58%-8%
9
10Expected ResultCompare-1Compare-2Compare-3
11Orange JuiceGoodVery good-2%Good0%Bad6%
12my targetmy targetmy target
13
14
15
16
17
18
19
20Note :
21Good vs Very Good (cause Very Good is higher level than Good, based on number of level so put index is -2%.
22Good Vs Good (in same level 2 vs 2, based on numbe rof level so put index is 0%
23Good vs Bad (cause Good is higher level than Bad , based on number of level so put index is 6%.
Sheet1


my target in cell E12, G12 & I12...
this attachment file for more easy understanding

thank for your helping.

.sst
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This needs some different examples to aid with the explanation, the solution is probably quite simple but it is unclear how you get the results that you expect.
 
Upvote 0
hi Jasonb75, thank for your suggestion. & correction.
i'm using Excel 2013 and Excel 2016..
I hope you have solution
 
Upvote 0
hi..i have additional example..
vlookup compare.xlsx
BCDEFGHI
3datacriterianumber of levelindex1index2
4Orange JuiceVery good10%0%
5Orange JuiceGood22%-2%
6Orange JuiceEnough34%-4%
7Orange JuiceBad46%-6%
8Orange JuiceWorst58%-8%
9
10Expected ResultCompare-1Compare-2Compare-3
11Orange JuiceVery goodVery good0%Enough4%Bad6%
12Orange JuiceGoodGood0%Very good-2%Very good-2%
13Orange JuiceEnoughEnough0%Worst8%Good-2%
14Orange JuiceBadBad0%Bad0%Very good-6%
15Orange JuiceWorstWorst0%Enough-4%Worst0%
16
17Note :
181Good vs Very Good (cause Very Good is higher level than Good, based on number of level so put index is -2%.
192Good Vs Good (in same level 2 vs 2, based on numbe rof level so put index is 0%
203Good vs Bad (cause Good is higher level than Bad , based on number of level so put index is 6%.
214Column C11 till C15 as basis (clue)
225my target in column E11-E15; col. G11-G15 and col.I11-I15
Sheet1
 
Upvote 0
Is this what you want? One of your example results doesn't appear to match the rest.

Book3
BCDEFGHI
3datacriterianumber of levelindex1index2
4Orange JuiceVery good10%0%
5Orange JuiceGood22%-2%
6Orange JuiceEnough34%-4%
7Orange JuiceBad46%-6%
8Orange JuiceWorst58%-8%
9
10Expected ResultCompare-1Compare-2Compare-3
11Orange JuiceVery goodVery good0%Enough4%Bad6%
12Orange JuiceGoodGood0%Very good-2%Very good-2%
13Orange JuiceEnoughEnough0%Worst4%Good-2%
14Orange JuiceBadBad0%Bad0%Very good-6%
15Orange JuiceWorstWorst0%Enough-4%Worst0%
Sheet1
Cell Formulas
RangeFormula
I11:I15,G11:G15,E11:E15E11=-VLOOKUP($C11,$C$4:$E$8,3,0)-VLOOKUP(D11,$C$4:$F$8,4,0)
 
Upvote 0
Is this what you want? One of your example results doesn't appear to match the rest.

Book3
BCDEFGHI
3datacriterianumber of levelindex1index2
4Orange JuiceVery good10%0%
5Orange JuiceGood22%-2%
6Orange JuiceEnough34%-4%
7Orange JuiceBad46%-6%
8Orange JuiceWorst58%-8%
9
10Expected ResultCompare-1Compare-2Compare-3
11Orange JuiceVery goodVery good0%Enough4%Bad6%
12Orange JuiceGoodGood0%Very good-2%Very good-2%
13Orange JuiceEnoughEnough0%Worst4%Good-2%
14Orange JuiceBadBad0%Bad0%Very good-6%
15Orange JuiceWorstWorst0%Enough-4%Worst0%
Sheet1
Cell Formulas
RangeFormula
I11:I15,G11:G15,E11:E15E11=-VLOOKUP($C11,$C$4:$E$8,3,0)-VLOOKUP(D11,$C$4:$F$8,4,0)

hi jasonb75...
thank you but your formula not fully worked. you're right my sample not fully representative my problem..
i just adding my sample with combination & alternative, adding data and adding in New Level & New Index
TEST_ADJUSTMENT CORRECT OK.xlsx
BCDEFG
3dataBasisnumber of levelindex1index2
4Orange JuiceVery good10,00,0
5Orange JuiceGood22,0-2,0
6Orange JuiceEnough34,0-4,0
7Orange JuiceBad46,0-6,0
8Orange JuiceWorst58,0-8,0
9in different index & level
10ApleVery good11,0-1,0
11ApleGood12,0-2,0
12
13BananaVery good10,00,0
14BananaGood13,0-3,0
15BananaEnough26,0-6,0
16
17Expected result
18dataBasisCompare-1indexSHOULD BE
19Orange JuiceVery goodVery good-6,00,0FALSE
20Orange JuiceEnoughEnough0,00,0TRUE
21Orange JuiceGoodBad4,04,0TRUE
22Orange JuiceWorstVery good-8,08,0TRUE
23ApleGoodGood?0,0cause in the same level (1 and 1)
24ApleGoodVery good?0,0cause in the same level
25BananaEnoughEnough?0,0cause in the same level
26BananaVery goodEnough?6,0cause in diferent level
27BananaGoodVery good?0,0cause in the same level
28BananaEnoughGood?-6,0cause in diferent level
Sheet2
Cell Formulas
RangeFormula
E19E19=-VLOOKUP($C19,$C$4:$E$8,3)-VLOOKUP(D19,$C$4:$F$8,4,0)
E20:E22E20=-VLOOKUP($C20,$C$4:$E$8,3,0)-VLOOKUP(D20,$C$4:$F$8,4,0)


i hope you would help me out..
 
Upvote 0

Forum statistics

Threads
1,215,422
Messages
6,124,808
Members
449,191
Latest member
rscraig11

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