On CBSNews.com: Can 365 Nights Of Sex Fix A Marriage?

Microsoft Office

Host: Susan Harkins
Contact

Do your Excel users know what to do when they get an error — or do they just cringe when they see that dreaded #N/A!? For example, say your application lets them enter an employee ID number the Vlookup function uses to look up an employee’s name. If no number in the table corresponds to the user’s entry, Excel automatically returns #N/A! In response to that error message, the user may often spend quite a bit of time retrying that entry. A better message might be one that explains that the employee number is no active since the employee has left the company.

To replace the cryptic message with a meaningful message, earlier versions of Excel would require you to rewrite the lookup formula as part of an IF statement, such as:

=IF(ISNA(VLOOKUP(A2,$AA$1:$AB$99,2,False)),”This employee has left the company.”, VLOOKUP(A2,$AA$1:$AB$99,2,False))

While this statement would certainly make your spreadsheet more user friendly, it is not very efficient, forcing Excel to calculate VLOOKUP twice if the employee number is in the lookup table. To avoid having to recalculate the function twice in an IF statement, Excel 2007 offers an alternative: the IFERROR() function. Using IFERROR, you would replace the above formula with the following:

=IFERROR(VLOOKUP(A2,$AA$1:$AB$99,2,False), “This employee has left the company.”)

In addition to #N/A!, you can use the IFERROR() function to capture #DIV/0!, #NUM!, #NAME?, and #NULL! errors that you anticipate your users might get while working with your worksheet. For example, if a certain calculation frequently yields division by zero errors, the following IFERROR statement would provide a more meaningful message:

=IFERROR(D3/D6,”You cannot divide by zero. Change the value in D6 to a nonzero number.”)

Miss an Excel tip?

Check out the Microsoft Excel archive, and catch up on other Excel tips.

Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.

Print/View all Posts Comments on this blog

Excel 2003: IF(ISERROR...) badaza@... | 03/12/08
RE: Eliminate those unfriendly error messages with Excel 2007's IFERROR function randyvg@... | 03/12/08
RE: Eliminate those unfriendly error messages with Excel 2007's IFERROR function jhdphd@... | 03/12/08
Re: Where do you put the IFERROR formula? Avner_Uzan@... | 03/12/08
it Replaces the original formula Rafiki | 03/12/08
phone # lookup dhays | 03/13/08
Cannot run the macro ‘EUROTOOL.XLAM!OnRibb<nLoad’. The macro not be availab love2oceanfl@... | 07/06/08

What do you think?

Trackbacks

The URI to TrackBack this entry is: http://blogs.techrepublic.com.com/msoffice/wp-trackback.php?p=443

No trackbacks yet.

Recent Entries

Archives

TechRepublic Blogs



Cisco IOS Command Chart (IOS v.12+)
Becoming proficient with Cisco equipment means remembering a whole new set of commands. These command charts give you a quick way to look up the needed IOS commands and switches when you need them.
Buy Now
Quick Reference: PC Troubleshooting Pack
Help desk and IT support professionals need the fastest and most complete answers to keep every PC in action. Get the PC troubleshooting solutions you ...
Buy Now

Storage Virtualization

advertisement
Click Here