Note to self

posted by Emma on April 2, 2008 10:49 AM

ExcelGrab.jpg

It's highly unlikely that anyone except me will find this useful. But I have to admit that sometimes I use this blog to make a note just for myself to refer back to later. Evil, I know. Anyway, if you want to know some arcane function in Excel, click on.

This:

=IF(ISERROR(VLOOKUP(F42,Sheet1!B:F,5,FALSE)),"-",VLOOKUP(F42,Sheet1!B:F,5,FALSE))

is very handy. A normal IF function looks like this:

=IF(VLOOKUP(F54,Sheet1!B:F,5,FALSE),VLOOKUP(F54,Sheet1!B:F,5,FALSE),"-")

That means:

IF the Vlookup function is true, return the result of the Vlookup, otherwise return a dash in the cell.

It looks more complicated than it is - it's simply saying if(this logical test is),(true, return this value),(false, return this value).

However, if the test returns an #N/A, you have to manually delete the cell, because it won't sum if it's in a range of cells that needs to be summed. And in a scale out, which is what I mainly use Vlookups for nowadays, that takes about a minute. A minute that I could be profitably using looking out of the window, or petting the cats. So naturally it must be eliminated.

So by inserting an ISERROR function as in

=IF(ISERROR(VLOOKUP(F42,Sheet1!B:F,5,FALSE)),"-",VLOOKUP(F42,Sheet1!B:F,5,FALSE))

You can get rid of the #N/As automatically. Magic!

Oh, no-one's reading this. Em of the future, when you search for this post next time you do a scale out: just remember that the ISERROR function will get rid of those annoying #N/As.

spacer

Comments: 4


I'm a big fan of ISNA in a similar role...


I'm glad I write fiction, not code - though I suppose fiction is a code of its own.

And my newly posted short story takes place in a SNOWSTORM!



Or the lazy way of summing

=SUMIF(A1: A18,">#N/A")


or leave out the dash altogether and just have "" for completely empty cell

Not at all useless - I use this sort of function all the time

spacer

Post a comment

We love hearing from our readers, but please stay relevant and pleasant. The comments are for responding to the specific blog post above. If you have any other queries, please contact Snowbooks via email. Off-topic or offensive comments will be removed without notice.

To screen out automated spam, please answer the following very easy question:

What colour is nice, new snow?

(please use all lower-case characters for your answer; no capitals)


Back to the blog »