Wednesday, March 31, 2010

NCAA Bracket Madness by David Tyler

We have a special treat for you today. Our very first guest blogger is David Tyler, the creator of what I consider to be the best March Madness Excel bracket on the internet, as I stated in a previously. I really appreciate David taking the time and sharing his insight, experience, and wealth of information with us today. Now, on to the article!
 -------------------------------------------------------------------------------------------------------

Every March, thousands of people fill out NCAA basketball tournament brackets, for which someone is faced with the challenge of running the pool.  This process can be tedious and fraught with human error.  To alleviate this, we can use a two-file Excel solution: a Bracket file submitted by all pool participants, and a Pool Manager file used to track the results once the tournament has begun.

Nick asked me to provide a brief posting on how these files work.  Below is a basic overview, but I recommend poking around the files to learn more.  Please bear in mind that the bracket files aren't perfect, and there are better ways that I've often been too lazy to implement, but the current files serve their purpose.

The Brackets

Most importantly: we need good, clean data.  Let's say there is a game involving Massachusetts.  If the participant puts the winner as "UMass," a human understands what that means, but Excel doesn't.  The file needs to have "Massachusetts" exactly.

To keep data consistent, all participants must submit the exact same bracket file.  By using VBA code that allows the user to click on a cell to advance that team, there is no opportunity for mis-typing.  The user clicks on "Massachusetts" in cell B4 and it automatically advances the cell's contents ("Massachusetts") to cell C5.  The user sees this as a quick and easy way to fill out a bracket; in reality, its main purpose was to help ensure good data.

For users who don't/can't enable macros, the file also uses a combination of Data Validation, formulas, and Conditional Formatting to ensure clean data.  Having alternative checks is an important component to maintaining clean data.  Many thanks to my friend Tom Szarek for the clever design of these great VBA-free features.

Collecting the brackets

With everyone using the same bracket file, we always know what data is going to be in which cells - e.g., C5 will always have the winner of the upper-left region's 1-16 matchup.  This allows the Pool Manager file's VBA code to open a participant's bracket (previously saved off to the pool administrator's hard drive), store the picks in an array, and then write those picks at a row of data in the Pool Manager file.  This is automatically repeated for all participants, storing all pool participant data on the same worksheet.  At this point, the Bracket files are no longer of any use.

Evaluating the brackets

Using formulas, we compare the actual winners of the games (from the MasterBracket tab) with the participant's picks.  If 'actual winner' on MasterBracket = the 'pick' on the Picks tab, the participant earns the points from that game.

The participant score is computed instantly with formulas on the Leaders tab.  VBA then sorts the leaderboard in descending order so the highest scorer is on top.  The resorting could be done with some array formulas, similar to those used on the PartInfo tab, but VBA is easier and less resource intensive.

Enjoy March!

Any time you are doing the same task multiple times, you need to question how Excel and VBA can be used to reduce the workload.  With these files, pool administrators can handle a large number of participants with little additional effort.  Further, once the Pool Manager file has all data, the administrator can send the file to all pool participants -- this lets participants track scores on their own, generate scenarios, and see other pool participants' picks.  The less time spent on administration, the more time there is to enjoy the games and the taunting of friends in the pool.

----------------------------------------------------------------------------------------------------------

That was great David, very informative, especially the part about reducing the workload when working with repetitive tasks. I've found that to be very true in my engineering work experience. Thanks again for sharing with us. Don't forget to check out David's blog here.

We're always looking for innovative and unique features and spreadsheets utilizing Microsoft Excel so please don't hesitate to contact me with your ideas or if you are interested in guest blogging.  Thanks for reading.

Monday, March 29, 2010

How do I make horizontal rows into vertical rows in Excel Spreadsheet?

To make horizontal rows into vertical columns, highlight the cells you want to change, copy, right click cell you want to move to, select ‘paste special’, click ‘transpose’ box, hit ok. It's that simple!

Join our free email newsletter for more advanced Excel tips to make your life easier! Don't worry, we won't swamp your inbox and you can unsubscribe at any time. We'll even send you some useful Excel templates from time to time. Cheers!
 

Wednesday, March 17, 2010

What’s the best 2010 NCAA Excel Bracket?

March Madness is here! Are you looking for a great way to start an NCAA Basketball Tournament pool with your friends or coworkers? After downloading several different Excel spreadsheet brackets I think I have found the best one.



Through the use of several macros, the bracket is very easy to use and has a very clean appearance (much more so than most of the other Excel brackets that I downloaded). You can even create html pages to post on the web the current standings. Download it and see for yourself!
 


(Note: there are two files to download, the blank bracket to distribute to all of your friends plus the Pool Manager to keep track of all your scores. Instructions are included!)

Sunday, February 28, 2010

How do I insert the degree symbol in Microsoft Excel? (And other keyboard shortcuts)

There are a number of keyboard shortcuts that can be used to generate symbols in Excel spreadsheets. The most asked about one is how to insert the degree symbol. Here is a list of some of the most frequently used keyboard shortcuts:

Alt + 0176 = ° (Degrees)
Alt + 0149 = • (Bullet)
Alt + 0162 = ¢
Alt + 0188 = ¼
Alt + 0189 = ½
Alt + 0190 = ¾
Alt + 0177 = ±
Alt + 0178 = ²
Alt + 0179 = ³
Alt + 0163 = £
Alt + 0128 = €
Alt + 0151 = — (m dash)
Alt + 0150 = – (n dash)
Alt + 0187 = »
Alt + 0169 = ©
Alt + 0174 = ®
Alt + 0165 = ¥
Alt + 0177 = ±
Alt + 0247 = ÷
Alt + 0166 = ¦
Alt + 0134 = †
Alt + 0227 = ã
Alt + 0191 = ¿
Alt + 0161 = ¡
Alt + 0209 = Ñ
Alt + 0241 = ñ
Alt + 0225 = á
Alt + 0233 = é
Alt + 0237 = í
Alt + 0243 = ó
Alt + 0250 = ú
Alt + 0252 = ü
Alt + 0186 = ° (1° = primero)
Alt + 0170 = ² (2² = segunda)

As with most software these days, there are a number of different ways to get to the same result. You can also use character map to use the symbol you are looking for:

A character map of all special symbols, including foreign language characters, can be displayed by going to Start>Run, typing charmap, and clicking OK (Windows XP users). Vista users will type charmap into the Search window at the bottom of the Start Menu. Choose the font corresponding to the one you're using and click on a character. Next click Select>Copy to copy the character. Return to your document, click where you want the character inserted, and go to Edit>Paste (or do Ctrl+V) to insert it.

Finally, the simplest way is simply to where MSOffice users can go to Insert>Symbol to accomplish the exact same thing.

Monday, February 22, 2010

How do you automatically enable macros when Excel is opened?

Slide 66
To automatically enable all macros when Excel is opened so you don’t have to do it manually every time, please read the following instructions:
Slide 67
1. In Excel, click the Office button in the upper left corner of the screen. 
 
 Slide 67 2. Click the "Excel Options" button in the lower right.

  
Slide 67
3. Click the "Trust Center" button on the left. Then, at the bottom right, select "Trust Center Settings" as shown below.
 
Slide 67
4. In the next window, select "Macro Settings," then select the radio button for “Enable all macros."
 
  There you have it! Now you don't have to enable the macros every single time that you open Excel.

Monday, February 15, 2010

How do I use a formula to count the remaining days until the end of the month in Excel?


Using the =DAY(TODAY()) commands I can get the date 2/15/2010 to show that we are on day 15 of the month. I would like the number all the way up to the last day of the month and then stay there. In this example November counted up to 30 days, Dec to 31, Jan to 31, and since today is the 15th of Feb it is currently on 15. Tomorrow it will be 66. After the 31 I would like it to stop at 31. Is there a possible formula for this?
Month
Days
2009-Nov
30
2009-Dec
31
2010-Jan
25
2010-Feb
15
Yes there is a formula. First, you would need to have a fixed component or refer to a year/month value. Try this for January 2010:

=IF(--TEXT(TODAY(),"yyyymm")>201001,DAY(DATE(2010,2,0)),DAY(TODAY()))
That formula would begin by returning 1 on 01-JAN-2010 and increment by 1
each day up through 31-JAN-2010...then it would stay at 31

February 2010 would be this:
=IF(--TEXT(TODAY(),"yyyymm")>201002,DAY(DATE(2010,3,0)),DAY(TODAY()))

Now, one other thing you can do is take the 201002 numbers and place those in a separate column and then just point to that column in your formulas.


What do the hypens before TEXT do? A leading hyphen causes Microsoft Excel to interpret the contents of a cell as a formula. If you want to use a leading hyphen but not create a formula, use an en dash (option-hyphen) or an em dash (shift-option-hyphen) in place of the hyphen. Excel treats them like any letter or number.
You can also force Excel to treat the contents of any cell as text by typing an apostrophe at the beginning of the cell contents. Alternatively, format the cell as text (choose Cells from the Format menu, click the Number tab, and double-click Text in the category list). After changing a cell to text format, you may have to press command-U to make the change take effect.
Apostrophes (') and hyphens (-) are ignored, with one exception: If two text strings are the same except for a hyphen, the text with the hyphen is sorted last.


Monday, February 8, 2010

How do I create a week ending date formula for an expense report?

Let’s say you are putting together an expense report sheet for all of your employees to use. You want them to be able to enter a week ending date and the spreadsheet will automatically compute the rest of the dates for the week. Here are the two main formulas we will be using:

=IF(B1<>"",IF(WEEKDAY(B1)<>7,B1+7-WEEKDAY(B1),B1),"")

=IF($B$2<>"",$B$2-6,"")

First it says, if the date in cell B1 does not equal (< >) blank (“”), then go on to the next part of the formula, otherwise leave blank. The formula =weekday() returns a number 1 to 7 identifying the day of the week of date. In our example, I have chosen 2/12/2010 as the week ending date. =weekday(B1) turns out to be 6. So, if the weekday of B1, which is 6, does not equal 7, then take the value of B1, 12, add 7 to get 19, then subtract weekday of B1, 6. We end up at 13. (recap: 12+7=19. 19-6=13.) The date displayed is 2/13/2010.



Now it is on to the next formulas for each day. Sunday’s formula is: =IF($B$2<>"",$B$2-6,""). If B2 does not equal blank then subtract 6, otherwise leave blank. In our example we have 13-6=7 which gives us the correct date for Sunday, February 7, 2010. The formula for Monday is: =IF($B$2<>"",$B$2-5,"") which gives us 13-7=8 for Feb. 8th and so on until Saturday. There you have it, one easy way to improve your expense reports.


I could just put this up as templates and not even bother explaining how they work but how many people would take the time to try and figure out how they work? You will learn a lot and feel much more accomplished if you try building these spreadsheets on your own. Feel free to let me know if you have any questions or comments.