I've been toying too much with excel, of late, and I have trouble finding a solution to a simple problem : calculating the odds (%) of glitches happening per dice pool number.

Glitches, if I'm not mistaken, happen if :

- Exactly half or more than half the number of dice rolled turn out to be 1's.
- If the number of dice is an odd number (3, 5, 7, 9, ... 37, etc.), then you divide the DP by 2 and round up. This means a DP of 3 must have 2 dice show up as 1's for a glitch to occur.

I'm trying to represent this on a table. If my previous calculations are exact (which I now doubt, given my failing math skills...), I should already have the odds for all DPs from 1 to 99, and for all threshold from 0 (failure) to 41 (which makes for a fraggin' huge table). Given that rows represent DP from 1 to 99, what I want is to add a first column called "Glitches" that gives me the odd of glitching on any DP from 1 to 99.

How can I translate this in a formula using excel ?

(As an afterthought, what would be the formula for "critical glitches", given they stem from a different condition ?)