dirq.net

the life and work of dirk watkins

January 12, 2007
by Dirk Watkins
1 Comment

Merge Worksheets in Excel

Lately there has been a lot of merging of worksheets in Excel at my work. Now, I don’t know why, but it seems that everyone is working in 10 or 15 different spreadsheets and keep on asking me to merge them. By merging they usually mean combining the columns based on a single column in one sheet.

For example, say I have two spreadsheets. One with Products and some information like color and UPC number. The other with products and some other information like length, width, and weight. The column that both sheets have in common is the product_id column. Now I want all that information in ONE spreadsheet.

So, the way to do this is with a simple Excel function called VLOOKUP.

Here’s the syntax (or how to use it) from Microsoft:

VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Lookup_value
The value to search in the first column of the table array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.). Lookup_value can be a value or a reference. If lookup_value is smaller than the smallest value in the first column of table_array, VLOOKUP returns the #N/A error value.

Table_array
Two or more columns of data. Use a reference to a range or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text are equivalent.

Col_index_num
The column number in table_array from which the matching value must be returned. A col_index_num of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. If col_index_num is:

  • Less than 1, VLOOKUP returns the #VALUE! error value.
  • Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.

Range_lookup
A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:

  • If TRUE or omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.
  • If FALSE, VLOOKUP will only find an exact match. In this case, the values in the first column of table_array do not need to be sorted. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.

So now, for the example above, we need to make sure that the product_id columns are both in the first column in each worksheet – “A”. The VLOOKUP function needs that to be able to work correctly. We’ll then start off with:

=VLOOKUP(A2,

This means that we’re looking at the first column, 2nd row (A2).

Now we’ll put in the range that we are looking into. The second sheet will have the product_id in column “A”, and the height in column “B”. There 1000 lines in this sheet (including the header on row 1). So our code now looks like:

=VLOOKUP(A2, Sheet2!A2:B1000,

The neat thing here is that you can reference worksheets that aren’t even in the same file.

We’re going to modify that a bit so that the Table_Array is fixed for when we drag this function down through the cells later on. The way you “fix” the range is to add dollar signs ($) before each of the cell references in the function:

=VLOOKUP(A2, Sheet2!$A$2:$B$1000,

The third and forth things are pretty simple so we’ll combine them into one step here. The 2 means that we want to return the value for the 2nd column where the first columns (product_id) match up. The 0 (or false) means that we want to have the function find an EXACT match for the product_id. Keep in mind that EXACT means EXACT. If there are spaces at the end of the product_id in one worksheet and not the other the fields will NOT MATCH EXACTLY.

So here’s the final VLOOKUP code:

=VLOOKUP(A2, Sheet2!$A$2:$B$1000, 2, FALSE)

Remember that these are references and sometimes you’ll need to copy and paste-special with just the values to keep the references static. If not you just have to make sure whatever you are referencing is always available to this spreadsheet function.

October 9, 2006
by Dirk Watkins
1 Comment

Linearality of the Blog Model

I’ve had this blog for a bit but I am always stretching for things to fit into this linear container. This format seems too structured and ordered for what I really want to have here. It’s just not representative of how I want the site to be or what I want to do outside of my daily web-development work.  I would like to post a lot of my new photo-works up here along with other artsy-fartsy stuff but the creation and display of those things is just not suited for a blog.  More of like a gallery.  Or just a large room with lots of wall space.  In any case I need to make some additions to this site for any of this to happen.
During the day I make things more efficient and organized. And, in a way, I don’t want to be that way here. I want to do what I used to. I want to do what I’m doing for Take Solace and what misprinted-type and radiohead have been doing utilizing the crazy-linked-labyrinth that only the web allows. I only wish I could find my old sites. (This is version 8 if you didn’t know).

The power of the web medium is the hyperlink and it’s non-linear nature. A blog, by definition, is linear because of it’s date ordering, journal style. I don’t have that daily-newspaper-style in me after 5pm anymore since it’s all been bled out. I don’t write that way either. I like to stick things in the middle. Add to the beginning. Change the end.

I’ll keep the blog as a subsection. [to archive this content and to allow me to add random ramblings when the mood arises]
Now that the decision has been made the next issue to deal with is what it should be. I think I’ll just start. I always find that’s the worst part, just starting. After that work just takes on a mind of it’s own. But definitely look for a new, haphazard dirq-web with this blog for a back-story instead of a main-feature.

September 26, 2006
by Dirk Watkins
Comments Off

Sufjan Stevens and My Brightest Diamond Show Review

Last night, around 7 pm, I was working on the Take Solace web site, designing at a feverish pace when my good friend Joe Dorn called. “Dirk. I have an extra ticket to Sufjan Stevens at 8 pm tonight at the Pabst. Want to go?” “Sure”, I replied, “If you pick me up.” (It’s not my fault I can’t see at night.)

So off we went to the show. We picked up his friend Tim, ran some quick errands, and arrived at the Pabst Theater around 8:30. Each of us grabbed a $3 tall of Pabst (we were at the Pabst Theater you know, and plus PBR is pretty good, especially at those rates) and went in to find our 12th row seats.

I was pleasantly surprised by the opening band – My Brightest Diamond. We only caught the last 3 songs but they were simply awe-inspiring. What I wouldn’t give to have a string and brass section at my disposal. Shara Worden, the lead singer and composer, is totally at home in front of all that instrumentation and even comes in front of it all with her incredibly intense vocals. The song Golden Star has a point where the orchestra drops out and she belts out this high note that turns into an angst ridden screech that filled my heart with joy. If that sounds impossible you should get their new album Bring Me The Workhorse, which was released on August 22nd on Asthmatic Kitty Records. I picked up the CD last night for $10 and it is all good. I like every single song, which in this day and age is hard to find.

My Brightest Diamond combines really sweet beats with flowing violins over rock guitar lines with punchy vocals reminiscent of Fiona Apple and Andrew Bird. Needless to say I really enjoyed the show although I missed most of it.

Sufjan Stevens headlined after with a 17 piece band. Sufjan was dressed as a song bird and the orchestra was dressed as butterflies. I’m not sure where that came from but it was funny to watch them try to move around with these large wings attached to each of them, Sufjan’s being the largest. Sufjan broke up the set with quirky stories about his childhood between songs, like the time he was chased by a bird wasp at a summer camp. If you haven’t heard Sufjan Steven’s music it is very folkloric and includes big band like orchestrations that repeat and build, get quiet to allow for his airy vocals and then build again to climax the song.

The highlight of the night, in my mind, was My Brightest Diamond although that Sufjan was very very good. Incredibly, they both shared the backup band. I’m not sure on the mechanics of this, who’s band is who’s, but the band behind them was very talented. Shara Worden, of My Brightest Diamond, sang and played guitar and some odd percussion instruments behind Sufjan as well. In any case the shared group worked out well and I savored the experience and am grateful Mr. Dorn brought be along for the ride.

September 19, 2006
by Dirk Watkins
1 Comment

Get the Best Out of Pandora

Here’s a great article on getting the best out of Pandora (a music site that will help you find new and exciting music):
15 ways to get more out of Pandora

I’m using the OpenPandora app right now and it rocks hardcore! It’s an application that runs on your local computer and talks to your Pandora account. Select a song or artist and Pandora will find music that is close to it. You’ll get all sorts of new material this way. It’s really sweet.

Here are some of the things that I have bookmarked recently:


September 14, 2006
by Dirk Watkins
Comments Off

Hidden Messages in Your Phone Number

There might be some crazy hidden messages in your phone number. Try this website out:

PhoneSpell

Believe it or not but my cell phone number didn’t have anything good in it but my work phone came up with these two:

hell-11308-hide

hell-1130-thief