Question about Computer Utilities & Maintenance
The IF() is the wrong one to use. Use "Iif()", as in:
=IiF(A3='Audit Exception Register'!B:B, COUNTIF('Audit Exception Register'!P:P,Y), 0)
Caveat about using Iif(), one that doesn't probably apply in this case, but keep it in mind: Don't use Iif when trying to return the values of "real" objects. Examples of "non-real" objects in the VB/A world are:
Integer, Double, etc... all the numeric "objects"
These are fine to use in IIf() statements. If however you will be returning some value that is part of an object, as in:
Iif(x=2, myObject.getSomeVal(), 0)
You run the very real risk that is myObject is null, your program will simply stop running. Iif() will NOT return a null error/exception; it will in fact just stop. This is a bug in the VB interpreter and/or in the Iif() function itself.
I am referring here to classic VBA (ie, pre-VB dot-Net). How .NET handles such cases, I don't know.
Posted on Mar 07, 2008
Tips for a great answer:
May 24, 2015 | Platinum Computer Utilities & Maintenance
Jul 07, 2010 | Microsoft Computer Utilities & Maintenance
Aug 18, 2009 | Microsoft Office Excel 2007 Full Version...
Jul 01, 2009 | Computer Utilities & Maintenance
Apr 18, 2009 | Computer Utilities & Maintenance
Jan 28, 2009 | Legato EMC DiskXtender 2000 (mkt-001400)
Feb 11, 2008 | Computer Utilities & Maintenance
Dec 02, 2016 | Internet Computer Utilities & Maintenance
155 people viewed this question
Usually answered in minutes!