VLOOKUP question

jfin1ty

New Member
Joined
May 15, 2023
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I have what I hope is an easy question.
I have the below code for checking if an order is urgent or not.
The way it works is that it checks order numbers on available stock in column C in one workbook and compares it to another workbook "HOTSPOTS" containing a list of all the urgent orders to determine which orders on the first workbook are urgent.

=IF(C8="","",IF(ISERROR(VLOOKUP(C8,[Hotspots.xlsm]HOTSPOTS!$R:$R,1,FALSE)),"NO","YES"))

If column C is missing an order number, then the result will be blank, if the result errors, then it will show as "NO" meaning that order is not on the hotspots list and is therefore not urgent and if no error occurs, this means that the order number is present on both workbooks and will show as "YES" as it is urgent.

My question is this, can I add to the formula an additional piece of code that will check the entry of another column at the same time?
That is to say that if the order number appears on both sheets and is therefore urgent, that it will then check if column "G" contains "YES" in that same row that the order number is found on in the "HOTSPOTS" workbook. Column "G" being yes means that the order is more urgent and therefore needs to result in "CRIT" being the result. If column "G" does not contain "YES" for that row, then the order is just urgent and the result should be "YES".
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
How about
Excel Formula:
=LET(x,XLOOKUP(C8,'[Hotspots.xlsm]HOTSPOTS'!$R:$R,'[Hotspots.xlsm]HOTSPOTS'!$G:$G,"NO"),IF(C8="","",IF(x="no","No",IF(x="yes","crit","Yes"))))
 
Upvote 1
Solution
How about
Excel Formula:
=LET(x,XLOOKUP(C8,'[Hotspots.xlsm]HOTSPOTS'!$R:$R,'[Hotspots.xlsm]HOTSPOTS'!$G:$G,"NO"),IF(C8="","",IF(x="no","No",IF(x="yes","crit","Yes"))))
Perfect! I have no idea how it works but it works wonders. Thank you 😊
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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