Minecraft Skins
The wife and I are playing some minecraft, look how adorable we are:
Mrs. Pinkin (I can only embed one of us at a time to view :( )
The wife and I are playing some minecraft, look how adorable we are:
Mrs. Pinkin (I can only embed one of us at a time to view :( )
Let's say you have an excel spreadsheet for guys that sell billboard space with 3 columns: Seller, Billboard Location, and number of days. Let's say you wanted to find out how many days John sold a certain billboard for. Excel doesn't have an elegant way built in for double-conditional sums. There's a plugin you can install, but the formula is UGLY, and really doesn't work past 2 variables. If you wanted to do a triple-conditional sum, you're basically out of luck.
The solution I've come up with uses 3 features:
First, we need to take all of our indexes and concatenate them, so that we have a unique field for each possible combination. This works for any number of indexes. In this case, like I showed above, we're concatenating the name and location. Then, you can run the SUMIF command with the unique column we created being the range to check. Let me create an example below:
| Rep | Board | Days Sold | Unique ID | SUM |
| Joe | One | 5 | =CONCATENATE(A2,B2) | =SUMIF(D:D,D2,C:C) |
| Joe | One | 10 | =CONCATENATE(A3,B3) | =SUMIF(D:D,D3,C:C) |
| Joe | One | 12 | =CONCATENATE(A4,B4) | =SUMIF(D:D,D4,C:C) |
| Joe | Three | 6 | =CONCATENATE(A5,B5) | =SUMIF(D:D,D5,C:C) |
| Chris | Two | 8 | =CONCATENATE(A6,B6) | =SUMIF(D:D,D6,C:C) |
| Chris | One | 9 | =CONCATENATE(A7,B7) | =SUMIF(D:D,D7,C:C) |
| Dave | One | 4 | =CONCATENATE(A8,B8) | =SUMIF(D:D,D8,C:C) |
| Dave | Two | 2 | =CONCATENATE(A9,B9) | =SUMIF(D:D,D9,C:C) |
| Dave | Two | 7 | =CONCATENATE(A10,B10) | =SUMIF(D:D,D10,C:C) |
This produces a table like this:
| Rep | Board | Days Sold | Unique ID | SUM |
| Joe | One | 5 | JoeOne | 27 |
| Joe | One | 10 | JoeOne | 27 |
| Joe | One | 12 | JoeOne | 27 |
| Joe | Three | 6 | JoeThree | 6 |
| Chris | Two | 8 | ChrisTwo | 8 |
| Chris | One | 9 | ChrisOne | 9 |
| Dave | One | 4 | DaveOne | 4 |
| Dave | Two | 2 | DaveTwo | 9 |
| Dave | Two | 7 | DaveTwo | 9 |
which you can then use the "Filter Uniques" function on the Unique ID column to pare down to this:
| Rep | Board | Days Sold | Unique ID | SUM |
| Joe | One | 5 | JoeOne | 27 |
| Joe | Three | 6 | JoeThree | 6 |
| Chris | Two | 8 | ChrisTwo | 8 |
| Chris | One | 9 | ChrisOne | 9 |
| Dave | One | 4 | DaveOne | 4 |
| Dave | Two | 2 | DaveTwo | 9 |
So, finally, once we remove the unnecessary columns and re-title the result column:
| Rep | Board | Days Sold Per User, Per Board |
| Joe | One | 27 |
| Joe | Three | 6 |
| Chris | Two | 8 |
| Chris | One | 9 |
| Dave | One | 4 |
| Dave | Two | 9 |
I made a video about this stuff that I've been playing with, it's so geeky it's awesome:
I've been developing a site where I'm using wordpress as a CMS more than a blog, for many reasons. I'm very familiar with it, I like the automated SEO, I think it's simple to use, etc. But one big challenge is the menu navigation and how to set it up. I want this to be automated and I don't want to have to edit the menu every time there's a new page.
To clarify the terms, there's a menu with "solutions" then "products" with 3 sub categories "indoor" "outdoor" and "media players." Plus there's a "guides" area and a "blog" area.
The menu system is handled by the category management. If a page is made that goes into the menu, you simply tag it with the category where it should go. You can click the main header of the menu to go to a page with all the posts in the category. Then you hover over the header of the menu, and I want a dropdown menu with a list of posts in there. I want to limit this to a certain number of posts, then have a button for "more" at the bottom. You can see an example here.
Let's take a look at the code at the start of my menu. This basically encapsulates the markup for the menu, and for the first dropdown. I have this in a separate "nav_menu.php" file but it could go in your header as well.
<div id="nav_menu">
<ul id="main-nav">
<li id="solutions-nav" class="singlelevel"><a href="./?cat=9&feature=solutions">Solutions For...</a>
<div class="subnav">
<ul>
<?php query_posts('cat=9&posts_per_page=10&orderby=title&order=ASC'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<li><a href="./?cat=9">More...</a></li>
</ul>
</div>
</li>
So, take a look at the php code there. First of all, important to note, this disrupts the wordpress loop so we'll need to fix it a little bit later. First, it does a post query limiting the list to one category (you can search by "category_name" but I'm a fan of the Id's) and then setting a limit to how many to pull; I chose 5 by default. Then, there's a while loop that pulls some data from each post and formats it into a listed menu entry. After the while loop closes, I throw out the "more" button which queries the whole category for posts.
If you do just that, every time you try to list posts you'll pull a list of every post you've got and it will supremely annoy you. You need to reset your post query to be able to limit it to the page at hand. At the bottom of my theme's "header.php" file, right before the posts would get displayed by "index.php," I added the following php line:
<php query_posts('cat='.@$_GET['cat'].'&p='.@$_GET['p']); ?>
This will pull the post list based on the categories selected or the specific post listed; all of my links and navigation are handled through those 2 "GET" variables so it will limit the posts queried to anything selected. Make sure to put the @ before $_GET to suppress any errors the get command gets, for example, if there's nothing passed.