ISERROR Comment

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
681
Office Version
  1. 2016
Platform
  1. MacOS
Hello Friends,



I am using this formula: =IF(AND(J2<>"C1313000",J2<>"C1313001"),VLOOKUP(H:H,DEfinitions!A:B,2,0),"")

And what it says is; If you see the "C1313000" or "C1313001" don't do the Vlookup and return blank. but now I need to be able to also say in the same formula if you do the vlookup and don't find the criteria you are looking for retunr the comment "AddToDef" and I am not sure how to enter the formula?


Normally when I do a Vlookup and want a comment I would use something like this. =If(ISERROR(VLOOKUP(H:H,DEfinitions!A:B,2,0),"ADDTODEF",VLOOKUP(H:H,DEfinitions!A:B,2,0))) but I got all that "IF" / "AND" formula in there so it doens't work?


I feel like I am just writing it wrong? any help would be much appreciated. Thanks!!


Excel 2003
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
You can still replace the VLOOKUP with your ISERROR version but you have a misplaced parenthesis, try like this

=IF(AND(J2<>"C1313000",J2<>"C1313001"),IF(ISERROR(VLOOKUP(H2,DEfinitions!A:B,2,0)),"ADDTODEF",VLOOKUP(H2,DEfinitions!A:B,2,0)),"")
 
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,164,275
Messages
5,836,337
Members
430,421
Latest member
Natas

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