Vlookup Formula to return "Item in stocK' if there is a match or "not in stock" if no match

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,135
Office Version
  1. 2021
Platform
  1. Windows
I have the following formula below


Code:
 =IF(IFERROR(VLOOKUP(A5,'[Group Stock Report.xlsm]shirts'!$J:$J,COLUMNS(J:J),FALSE),VLOOKUP(A5,'[Group Stock Report.xlsm]Trousers'!$I:$I,COLUMNS(I:I),FALSE))="","Item in stock","item Sold")


The ref number in the source file is in Col A

Kindly amend my formula so that where the ref in Col A matches the ref for Shirts in Col J or trousers in Col I then return "item in stock" or "item sold"


Your assistance in this regard is most appreciated
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,220
How about

=IF((IFERROR(MATCH(A5, '[Group Stock Report.xlsm]shirts'!$J:$J, 0),0)+IFERROR(MATCH(A5, '[Group Stock Report.xlsm]trousers'!$I:$I, 0),0)) > 0 , "item in stock", "item sold")
 
Last edited:

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,350
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
try

Code:
=IF(AND(ISERROR(VLOOKUP(A5,'[Group Stock Report.xlsm]shirts'!$J:$J,COLUMNS(J:J),FALSE)),ISERROR(VLOOKUP(A5,'[Group Stock Report.xlsm]Trousers'!$I:$I,COLUMNS(I:I),FALSE))),"item Sold","Item in stock")
 

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,135
Office Version
  1. 2021
Platform
  1. Windows
Thanks for the help. Both of your formulas works perfectly
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,960
Messages
5,856,525
Members
431,820
Latest member
Tori Murphy

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
Top