chris: (swings)
[personal profile] chris
1. Tomorrow sees the US Puzzle Championship, used as the qualifying test to select the national teams for the World Puzzle Championships in the countries of most, though certainly not all, of the people reading this. Theoretically I think you were meant to have registered by yesterday - whoops - but I registered yesterday and was still directed to the puzzles. (But perhaps I'll be disqualified for late registration! Who knows?) This year's puzzles look really good; I haven't tried the qualifier for several years, but this year's look fun. They also look accessible; I don't know how many I'll be able to finish, but I feel like I have a shot at most of them. (The last few, which will go completely over my head, look really inspired.) Threepeating US champ [livejournal.com profile] motris comments, as does test compiler Nick Baxter.

I'll be going in to the puzzles tomorrow "cold", but this test looks like it has a lot more to offer to more modest solvers - like me! - than previous years' tests do. If you've ever been attracted to the thought of taking part, this year looks like a really good one to try, even if it's your first one. Let Really Smart Guys, a lovely near-live blog written at the 2008 World Puzzle Championship, inspire you! Conversely, if you're frustrated by the annual puzzle championship schedule for national-class solvers apparently being one event long, the monthly-ish Oguz Atay Puzzle Contest is similarly very fine; I enjoyed stinking the place up in its fourth edition.

2. The World Series of Poker is in progress at the moment; in fact, it's about half-way through. Numbers are similar to those from last year; some tournaments are attracting more players than last year, some slightly fewer. My gut feeling is that it bodes well for the main event; while I haven't seen anyone quote an over/under for entrance figures and I'm not sure how the online qualifier numbers compare to last year's, I'd guess at about 7,000 - a little more than last year's 6,844 but below 2006's 8,773. The big story so far is that Phil Ivey has won two tournaments in the first half of the event; Brock Parker won two short-handed ("6-max") tournaments in quick succession and Ville Wahlbeck has impressed by so far taking first, second and third places in three of the five $10,000-buyin events he has so far entered.

3. Many people have observed the phonetic similarity of the name Johnny Marr, who plays guitar (for the Smiths, as it happens), to the French phrase "j'en ai marre", often translated "I'm fed up". However, "j'en ai marre" is just a sentence fragment; you would use it in the context "j'en ai marre de ((quelque chose))", or "I'm fed up with ((something))". There is a lovely bit of British English slang, "mardy", which could be translated as "fed up" in a similar way. (A BBC h2g2 author has more.) Accordingly, it's got me wondering whether the phonetically similar "marre de" and "mardy" might have some sort of linguistic link. Etymology or coincidence? (Or, alternately, perhaps someone doesn't like Tuesdays...)

4. Here is an Excel question. Suppose I have a table like so:
Day	Rain	Temp
Mon	14	8
Tue	19	10
Wed	12	10
Thu	22	13
Fri	11	12
and I'm looking to try to find the average Temp on days when there was more than 13 units of Rain. How would you do this? My approach, which doesn't seem to work (in Excel 2000 on a PC), is to create another column at the right-hand end where the cell is empty if there was no more than 13 units of Rain or contains the Temp value if there were more than 13 units of rain, like so:
Day	Rain	Temp	AltTemp
Mon	14	8	8
Tue	19	10	10
Wed	12	10	(empty cell)
Thu	22	13	13
Fri	11	12	(empty cell)
...whereby taking an average of the new right-hand column will give me the answer I need. Furthermore, should the rain value on Tuesday turn out to have been 9 instead of 19, changing the 19 to 9 should change the AltTemp from 10 to (empty cell), and so the average AltTemp should change from being calculated based on three figures to being based on only two.

Trouble is, I can't come up with a function I want to get this. I have tried something like =IF(B2>13,C2,#N/A) or =IF(B2>13,C2,#NULL!) - and so on for the remaining rows - but the average of a series which includes some numbers and some #N/As (or some #NULL!s) is #N/A, where I just want to skip over the cells with the #N/As in when performing the average. Can't help feeling this is going to be a really easy question for someone who knows better than me, but I've been working on this on the night shifts so haven't had anyone to ask and I haven't been able to work it out from the help. Accordingly, is it clear what I want - and, if so, how do I do it, please?

Re: did someone say Excel?

Date: 2009-06-20 12:43 am (UTC)
althea_valara: Icon captioned "Geek". (geek)
From: [personal profile] althea_valara
Suppose I have my list of mixed numbers and #N/As in column D

Excel treats errors such as #N/A and #DIV/0! specially. It's like Excel is thinking, "There should be a valid number here, but we don't know what it is/can't compute it, and thus I can't sum these together." Go figure. Happily, Excel will ignore alphabetic characters in a list of numbers to sum. So rather than returning #N/A or #NULL, I return "" instead. Or you can return "nope" or "FRAK" or anything alpha and it will just skip over it.

By extension, we can get the average of the numbers in the list from =(SUMIF(A1:A8,">0")+SUMIF(A1:A8,"<0"))/(COUNTIF(A1:A8,">0")+COUNTIF(A1:A8,"<0")) - but is there a neater way of doing it?

When it gets that complicated, I'd start considering pivot tables. Not sure if you know how to do them or not, but I'll explain anyway in case you or others don't know.

First, let's alter our data table somewhat.

DAY RAIN TEMP
Mon 14 8
Tue 19 10
Wed 12 10
Mon 22 13
Tue 11 12
Wed 8 11
Mon 13 9
Tue 20 11
Wed 14 12
Mon 11 10
Tue 10 10
Wed 17 11

And let's say you want the average temp on Wednesdays when the rain fall is over 13.

1) First, select your table by highlighting cells A1:C13. Then go to Data->PivotTable and PivotChart Report.
2) On the first page, leave both default options ("Microsoft Excel list or database" & "PivotTable") and click Next.
3) The next page lets us choose our range. Since we already did this by highlighting the data first, we can just click Next.
4) The final page lets you choose where to put the table. I usually leave it on New Worksheet. But before you click Next...
5) Click on Layout. This lets you set up the table:
5a)Drag Day to the PAGE area.
5b)Drag Rain to the ROW area.
5c)Drag Temp to the DATA area.
5d)Excel defaults to doing Sums on Pivots. We want Averages. So double click on the "Sum of Temp" field and change it to Average. Then click OK.
6) Click OK and Finish to complete the table.


You'll see this, which gives you the average temp per units of rain:
Pivot1


We want to limit it to Wednesday. Click the dropdown next to Day and choose Wed. Now you see this:

Pivot2


And finally we want to limit it to units of rain over 13. Click the dropdown next to Rain. Uncheck items that are over 13. You have this:


Pivot3


The grand total of 11.5 is your average temp on Wednesdays when rainfall is over 13. :)

For your PERCENTILE function, like I said up above, returning an alphabetic result from your IF statement should work.

Profile

chris: A birthday cake in the shape of a slightly cartoon-like panda (Default)
Chris

April 2025

S M T W T F S
  12345
67891011 12
13141516171819
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags