Get Excel to Automatically Launch Documents from an Exhibit List, Privilege Log, or Hot Documents List

Today I’ll explain how to create a schedule of documents or other files in Excel that includes a hyperlink for each document.  Anyone reviewing this list will be able to open any document described on it by just clicking the link.  This makes it easy to review a list of deposition exhibits or hot documents, or the internal version of a privilege log, and immediately review any document from the list that looks interesting.

Step 1:  Generate a list of the filenames that will be linked in the schedule.  They should all be in the same folder.  You can learn how to do this here.

NB:  If the filenames follow a predictable naming convention such as JX1, JX2, etc. the names can be generated with a formula such as =“JX”&A2 where column A contains the number of each exhibit.

Step 2:  Paste or create the filenames in the column of your choice.  In my example they are in Column A, and I’ve left cell A1 free:


Step 3:  Navigate to the folder that contains the files in Outlook Explorer.  In this example I want to link to the photographs saved in a subfolder called “late 2014” within the My Pictures directory:


Step 4:  Click in the address bar to make the full path come up.  Copy the path by hitting Ctrl+C


Step 5:  Paste the path in a convenient cell in your schedule file.  In this example I’ve pasted it in cell A1.


Step 6:  Use the HYPERLINK formula to generate a hyperlink to each document.  The function has two arguments: 1) the “link location,” i.e., the path to the file, including the filename; and 2) the “friendly name,” i.e., the text of the clickable message that you want to appear.  Excel prompts you for these two arguments when you type out the name of the function and the open parenthesis:


We’ve set the schedule up in such a way that the link location will follow a predictable pattern—we can simply “splice” the path in cell A1 and the file name in the adjacent cell of Column A to get the complete path to the relevant document.  The first formula—to launch the file in cell A3— looks like this:   =HYPERLINK($A$1&A3,”Open File”)

And this is how it appears onscreen:


See how the friendly name is what appears in the cell, while the underlying function you created is visible in the formula bar.  Note the use of dollar signs for the A1 reference (insertable by hitting F4), and the quotation marks around the friendly name text. 

Step 7: Copy the formula down to the rest of the filenames.  You can accomplish this by double-clicking the cross-hairs in the lower right-hand corner of cell B3.  Excel will generate the appropriate formula for each filename, concatenating the path in cell A1 and the correct filename.  Observe how the formula in cell B4 still refers to the path name in A1 (thanks to the dollar signs) but uses the filename in the same row, viz., A4:


Observe how clicking on the link next to the file IMG_1317.JPG launches the picture in a new window:


That’s all there is to it.  The key to making this work is that you have to have access to the folder containing the documents in the same environment in which the Excel file is open.  For example, if your documents reside in a local shared drive, someone in another office will not be able to open the documents from this Excel file because the links will not work.

If you want to make this file portable, make sure you use the correct path for the media where the files will reside.  For example, you could store all your deposition exhibits on a thumb drive, and put this file on the thumb drive as well.  Just make sure that the path you are using to launch the documents is the path that points to the thumb drive, not your computer back at the office.

Thanks for reading.  If you have an idea about how to use this tip in your law practice, please share it in the comments below.  To learn about hosting a CLE-approved Excel workshop at your law firm, company, public interest organization, or bar association, click here or email Ben Kusmin from Excel Esquire.

Posted in CLE, eDiscovery, Everybody, formulas, Lit Support, Privilege Logs | Tagged , , , , , , , | 4 Comments

Generate Properly-formatted Bates Numbers in a Snap

Let’s say you get the following panicked email from an attorney on your team:


You understand that these are the Bates numbers for documents on the Big Bank case, but you need to convert them to the proper format in order to pull them out of Relativity all at once.  Viz.,

62 refers to BigBank_000062

7550 refers to BigBank_007550

and so on.  The tricky part of this is adding the “BigBank_” prefix while also getting the right number of padding zeroes into each number.  You certainly don’t want to type them out one at a time–right?  Excel’s TEXT function makes this easy.

First, cut and paste those numbers into Excel and put the following formula in cell B2:


which generates the following result:


Here’s how the formula works:  “BigBank_” is the prefix for each Bates number, and the TEXT formula with the “000000” argument tells Excel to convert the number in Column A to text and add the appropriate number of padding zeroes to get a total of 6 digits.  The ampersand (&) combines both pieces into a single string of text.

Next, copy the formula by finding the cross-hairs in the lower right-hand corner of cell B2 and double-clicking, or dragging them down:


The copied formulas turn all of the raw numbers into properly-formatted Bates numbers:


That’s it!  As a housekeeping matter, it’s a good idea to get rid of the underlying formulas by copying the cells and pasting the values, like so:

First select the cells with the formulas/results, and then right click and choose Copy (or hit Ctrl+C)


Then select the same range of cells and paste the values right on top of them:


The cells will appear the same, but now the content of each cell is the resulting Bates number, rather than that funny formula–as reflected in the formula bar.


Now these Bates numbers can be pasted into Relativity or other document review platform.  Of course, this trick will work if you have 8 numbers or 800.

Thanks for reading.  If you have a thorny Excel issue, please share it in the comments below.  To learn about hosting a CLE-approved Excel workshop at your law firm, company, public interest organization, or bar association, click here or email Ben Kusmin from Excel Esquire.

Posted in CLE, eDiscovery, formulas, Lit Support | Tagged , , , | 3 Comments

Analyze Matter Data with Pivot Tables

In this post I’ll explain how to use one of the most powerful data analysis tools in Excel – the Pivot Table.  My example involves a list of new pro bono matters, but pivot tables are also an effective way to analyze email metadata or any other large data set.

Suppose your firm signed up 140 new pro bono clients across nine different programs in the last quarter of 2014. Each matter is represented in a row of the spreadsheet shown below. For each new matter, there are fields for the program, responsible attorney, date opened, and several other data points.


Now suppose you want to know how many new matters were generated in each program, or which program had the highest average cost in this quarter, or see a breakdown of new matters by borough? By month opened? By advocate? You can answer all these questions with a Pivot Table.  Keep reading to learn how.

You can download the Excel file by clicking here.

First, for Pivot Tables to work properly, you should make sure your data is the form of a table. That means no blank rows or blank columns in the data you want to sort.

To insert a pivot table, start by clicking anywhere in your table. Then navigate to the Insert ribbon and select PivotTable on the far left:


By default, Excel selects all the contiguous data for inclusion in the Pivot Table, and places the table on a new worksheet. You will usually want to accept these default settings:


Excel takes you to the new worksheet where the Pivot Table has been created. All you see at first is this intimidating diagram:


The first thing we’ll do is tally the number of clients in each program. Drag the “Program” field from the list into the Row Labels field and into the Values field.


Like magic, Excel tallies the number of clients in each program, as well as the grand total:


Now you can get a breakdown of the programs by any given category. Let’s see how many of the clients from each program are from any given borough. The trick is to visualize how you want the data to look and anticipate what the Row and Column headers will be.

Since we want a separate column for each Borough, we drag the Borough field into the Column Labels area.




NB: You can change the appearance of the headers by choosing Design –> Report Layout –> Show in Tabular Form

You can even drill down on a certain data point to see which records it includes.

At the intersection of Queens and Bankruptcy Clinic there is a 5, indicating that there are 5 clients in the Bankruptcy Clinic from Queens. Double-click on the number 5 and something neat happens:


Excel copies those 5 records and pastes them into a new worksheet! It’s a good idea to rename the worksheet to remind yourself what this data is. Double-click on the tab name, type the new name, and hit Enter.

Group by Date

Now let’s generate a breakdown of all the new matters by month.

The first step is to pull the dates into the Column area and see a breakdown by date.


This is not very useful yet, because it creates a breakdown for every single day. To collapse the breakdown to months, click on one of the dates and then select Group Field from the Options ribbon:


Choose Months and Years and hit OK


Now the Pivot Table will break down the count by Month:


Tally the expense subtotals by program

Remove the Date field from the Column area and drag the Expense field to the Values area:

After formatting these values as USD, you will see the subtotal of expenses for each program, along with the number of clients.


NB: You can format all the sum and average cells as US Currency by selecting them and then hitting Ctrl+Shift+$

Calculate the Average Cost per Client in Each Program

Now let’s look at the average cost per client for each program. The first, counterintuitive, step is to drag the Expenses field into the Values field again.


Now you’ll have two columns in the pivot table representing the sum of the expenses for each program:


Double-click on the Header, the cell that reads Sum of Expenses2, and you will see the option to change the value to an average:


Now you’ve got the Total in one column and the Average in the other:


You can also sort these Pivot Table results. If you wanted to view the above table by most expensive to least expensive program, you would click in the Sum of Expenses column and click the Z–>A button on the Options ribbon (you should be there by default):


With this result:


To make the Pivot Table more presentable, you can get rid of the Row Labels title by hitting the Field Headers button, and edit the other column headers by adding your own titles:


One last thing to remember about Pivot Tables: they do not update automatically if you add, delete, or edit the underlying data. If you want the Pivot Table to update, Go to the Options tab and hit the Refresh button.


These techniques are covered in-depth in my new CLE course† Excel Essentials for Busy Lawyers. To learn more about hosting a session of Excel Essentials at your law firm, company, or public interest organization, please email Ben Kusmin at Excel Esquire.

†The required fine print: Approved in New York for 2.0 CLE credits; approved for both new and experienced attorneys; financial aid available.
Posted in Uncategorized | 2 Comments

Reverse Names Easily with Find & Replace

A student in one of my CLE programs recently asked me the following question:  What do you do when you have a long list of names of the form “Cook, Mary” and you want to put them in the form “Mary Cook”?  This issue comes up so often I decided to write a post about it.

Suppose you have all those pesky names in a single column:


Although there are text functions that will extract the various parts of the name field, a much more straightforward way is to use wildcards within Excel’s Find & Replace feature to quickly isolate the first names and last names, and then recombine them.  Here’s how it works:

Step 1 is to copy the entire column of names into 2 helper columns:


Next, select Column B and hit Ctrl+H to launch the Find & Replace dialog box.  Tell Excel to replace ‘*, ’ with nothing:


This deletes everything up to and including the comma and the space after it, leaving just the first name:


Next, select Column C and hit Ctrl+H again.  This time replace  ‘, *’ (that’s comma space asterisk) with nothing.


This will delete everything from the comma onwards, isolating the last names:


Now you can combine the first and last names with this simple formula:


Copy the formula all the way down to recombine the rest of the names:


There you have it!  You’ll probably want to replace all these formulas with the resulting text values.  Do this by Copying Column D and then pasting back on top of it with the Paste-Special-Values button:


Thanks for reading.  If you have a thorny Excel formatting issue, please share it in the comments below.  To learn about hosting a CLE-approved Excel workshop at your law firm, company, public interest organization, or bar association, click here or email Ben Kusmin from Excel Esquire.

Posted in CLE, eDiscovery, Everybody, Lit Support, Practice Management | Tagged , , | 5 Comments