2 Vlookup's based on a variable?

mackento

New Member
Joined
Nov 4, 2015
Messages
1
Hoping someone can help me here!

As stated on the title, I'm trying to create a formula that will use either one of two VLookup formula's based on a variable that is in play.

=if(B3="Company1", (=vlookup(G3,'Table worksheet'!A:F,6,FALSE)), (=vlookup(G3,'Table worksheet'!A:F,5,FALSE)))

Essentially I want it to determine that if I choose company 1 or Company, it will import a rate dependant on the type of service selected in G3, and the rates are set out in a table in 'Table Worksheet', with column 6 being the rates for company 1, and column 5 being the rates for company 2.

Can anyone tell me if this is possible? It will be a Godsend if it is!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
First of all, you don't need the equal sign in your IF True and IF False argument.
Secondly, you may probably rewrite your formula into sth like
=VLOOKUP(G3,'Table worksheet'!A:F,match(B3,header_range,0),false)
depends on how your table is set up...
 
Upvote 0

Forum statistics

Threads
1,215,265
Messages
6,123,961
Members
449,135
Latest member
jcschafer209

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