ISERROR Comment

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
675
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
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

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)),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,517
Messages
5,596,620
Members
414,081
Latest member
Subaru_Steve

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