Logical Vlookup & index Formula

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
Office Version
  1. 2021
Platform
  1. Windows
I have a formula that if 95915 or 95925 or 95950 in in Col G, then lookup the description in Col 2 on sheet1 otherwise return the result of the Index formula

where 95915, 95925, 95950 is in Col G, the description from the Vlookup is not being used. I only get the results from the Inde formula



Code:
=IF(OR(G1615="95915",G1615="95925",G1615="95950"),VLOOKUP(Sheet1!$A$1:$B$11,2,FALSE),INDEX('[BR1tb(Cat).xls]TB'!$A:$A,MATCH(G1615,'[BR1tb(Cat).xls]TB'!$B:$B,0)))


it would be appreciated if someone could amend my formula
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Remove the inverted commas from your numbers, 95915 rather then "95915". Also your vlookup is invalid so thats needs fixing. You have no lookup value.
 
Upvote 0
Thanks for your input. have made the changes and it now works
 
Upvote 0
Hi Steve

the if(or function works with 2 criteria. I get #N/a when I add a 3rd criteria in the logical formula


Code:
 =IF(OR(G2=95915,G2=955925,G2=95910),VLOOKUP(G2,Codes!$A$1:$B$7,2),INDEX('[BR1tb(Cat).xls]sheet1'!$A:$A,MATCH(G2,'[BR1tb(Cat).xls]sheet1'!$B:$B,0)))



please check & correct
 
Upvote 0
Hi Steve


Have found my error-forgot to include false in the Vlookup after the 2 (second column)


Code:
=IF(OR(G2=95915,G2=955925,G2=95910),VLOOKUP(G2,Codes!$A$1:$B$7,2,false),INDEX('[BR1tb(Cat).xls]sheet1'!$A:$A,MATCH(G2,'[BR1tb(Cat).xls]sheet1'!$B:$B,0)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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