nested VLOOKUP

EVCOdan

New Member
Joined
Aug 30, 2023
Messages
10
Office Version
  1. 2021
Platform
  1. Windows
Hi all,

I'm kind of new to this and trying to write a script that will target data from a different row in the event there is an entry in a specific column of the current row being searched by VLOOKUP

Here is what I'm currently doing, which works if there is no secondary search.


Current script below

=IF(D416="","",VLOOKUP(D416,'Item Browse'!A:AK,37,FALSE))*N416



Script does the following;

If Item# is nothing then nothing is entered
then
If Item# is something then look for Item# in item browse sheet, columns A through AK
then
If found then input column 37 into cell
then
If not found then false
then
Multiply by cell n(column)



Trying to make script do the following;

If Item# is nothing then nothing is entered
then
If Item# is something then look for Item# in item browse sheet, columns A through AK
then
If routing code is something then look for item # in routing code(column) in item browse sheet, columns A through AK
then
If found then input column 37 into cell
then
If not found then false
then
Multiply by cell n(column)

Any help would be greatly appreciated!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Something like this maybe
Book1
ABCDEFGH
1ItemdescpriceRoutingCol37
2ab12321cd
3cd456313
4ef78941
5gh65451
6ij98761
7kl32171
8mn25881
9op14791
Item Browse
Cell Formulas
RangeFormula
H3H3=IF(H2="","",IFNA(VLOOKUP(H2,$A$1:$E$9,5,FALSE)*F2,IFNA(VLOOKUP(H2,$D$2:$E$9,2,FALSE)*F2,"FALSE")))


Excel Formula:
=IF(D416="","",IFNA(VLOOKUP(D416,'Item Browse'!A:AK,37,FALSE)*N416,IFNA(VLOOKUP(D416,'Item Browse'!RouteCodeColumn:AK,37-RouteCodeColumn,FALSE)*N416,"FALSE")))
 
Upvote 1
Apologies. Have finally gotten a chance to look at this. If i am not mistaken it looks like what you have suggested is trying to search for data in two different locations of the same sheet.

What Im trying to do is search for the item within the sheet and then if there is a value in the routing code column, to bring the number from that routing code column rather then the original column, but only in the event that there is data in the routing code column.
 
Upvote 0
I think it would be much clearer if you showed up some sample data and walked us through an actual example using that data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 1
Yep I figured it out. Details below.

Just sample string that I have to update to accommodate but it's doing exactly what I'm looking for.

1694186459749.png



Excel Formula:
=IF(A2="","",IFNA(VLOOKUP(B2,A:D,4,FALSE),IFNA(VLOOKUP(A2,A:D,4,FALSE),"FALSE")))
 

Attachments

  • 1694186438591.png
    1694186438591.png
    3.1 KB · Views: 2
Upvote 0
Solution

Forum statistics

Threads
1,215,256
Messages
6,123,906
Members
449,132
Latest member
Rosie14

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