Combining Vlookup and IFS

ChrisLane

New Member
Joined
May 22, 2014
Messages
38
Good afternoon. I have two tables as follows:
Table 1 has a client's name, and pack mode. The pack mode can be any of three items (FCL, LCL or LSE)
table two has two columns, one for pack mode and one for the related price. Each pack mode has its own price.

I need to do a vlookup in table 1 which will find the client name, and the related pack type. then, as part of the vlookup, I need a variable that will lookup the pack type in the second table and return the related price.

To do this, I am trying to combine Vlookup and IFS, and have derived the following formula.

=VLOOKUP(E6,'PM_Client_Matrix - New'!$B$1:$H$1276,IFS(K6="FCL",VLOOKUP([Package Type],'PM_Client_Matrix - New'!G1:H1276,2,FALSE),K6="LCL",VLOOKUP([Package Type],'PM_Client_Matrix - New'!G1:H1276,2,FALSE),K6="LSE",VLOOKUP([Package Type],'PM_Client_Matrix - New'!G1:H1276,2,FALSE)))


The formula returns a #N/A error. i have checked that the client in e6 appears in column B in table 2, and that the package type is in column B in table 2. I tried OR instead of IFS, to no avail.

Can somebody spot my error, please?

Kind regards

Chris
 
Hi Fluff. i have tried the apps referred to, but none of them work with my Excel 365/Windows 10. Further, I cannot figure out how to remove the Jeanie macro - I have tried to delete the code via the VB editor in the Personal workbook, but although I can see the macro in VB editor, I do not see how to delete it, and it is an autorun macro?. When I unhide the workbook, click on developer>macro the macro isn't listed. I am very frustrated as I need to post the screenshots of the worksheets, but the apps you refer to don't work in my Excel 365.
many thanks
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Fluff. I managed to remove the macros, so not to worry. However, I am still battling with the Index formula you supplied. But, perseverance is my middle nane
 
Upvote 0
Hi Fluff.
I have being getting mixed results, have realised the shortcoming in your example. If i may explain

Your rows 1:8 are correct, except that Column C is where the formula sits to collect the premium % (where formula sits) - this would comprise table 1.

Table 2
Rows 13 onwards
Column A contains the client Name, Column B the pack Type and Column C the insured rate.

As mentionedin a previous post above, in table 2 the same client can have three different pack types, each with their own insured rate. So table two can consist of multiple rows of different clients, pack types and rates

So, the formula I am trying to derive looks in column A in table 1 for the client, tries to find the same client in table 2.
Then it will look for the Pack Type in column B in table 1, and try to find the pack type in table 2.
So, having found the correct combination of client and pack type, the related insured rate will by inserted in table 1, column C

So it is a double lookup to find the correct combination of client and pack type, to matvh the correct insured rate.

Kind regards
 
Last edited:
Upvote 0
More like this


Excel 2013/2016
ABC
1NamePack
2Tom PearceFCL10
3Bill BrewerFSE15
4Jan StewerLCL17
5Peter GurneyFSE#N/A
6Peter DavyFCL#N/A
7Dan'l WhiddonFSE#N/A
8Harry HawkeLCL#N/A
9
10
11
12Packprice
13Tom PearceFCL10
14Tom PearceLCL11
15Tom PearceFSE12
16Bill BrewerFCL13
17Bill BrewerLCL14
18Bill BrewerFSE15
19Jan StewerFCL16
20Jan StewerLCL17
21Jan StewerFSE18
Sheet1
Cell Formulas
RangeFormula
C2{=INDEX($C$13:$C$21,MATCH(A2&B2,$A$13:$A$21&$B$13:$B$21,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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