Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi! I'm counting things in my database. So I get records like
fleem spork morgo darp a 1 ˜º 2 b 1 ˜º 4 c 1 ˜º 9 a 2 ˜º 4 c 2 ˜º 2 a 1 ˜¼ 1 b 1 ˜¼ 5 c 1 ˜¼ 2 a 2 ˜¼ 3 b 2 ˜¼ 0 c 2 ˜¼ 4 in my query, where 'darp' is my aggregate. So, I load this into my pivot table with a little VBA, and I include the line ' show zero for the null fields pt.NullString = "0" OK? I now have a pivottable that looks like Sum of darp morgo spork fleem ˜º ˜¼ 1 a 2 1 b 4 5 c 9 2 1 Sum 15 8 1 Average 5 2.666666667 2 a 4 3 b 0 0 c 2 4 2 Sum 6 7 2 Average 3 2.333333333 Now, I want to get the average of darp over a fleem. But, since there is no spork = 2 value defined for fleem=b and morgo=˜º, the average of all darp over spork=2 is (4+2)/3 = 3, not (4+2+0)/3 = 2. For spork = 2, fleem = b, morgo=˜¼, the 0 is defined and behaves correctly. How can I get this query to treat that missing value as a zero value? I'm trying calculated fields, but they seem not to have subtotals at all. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with calulating Null fields | Excel Worksheet Functions | |||
Pivottable Sum of fields. | Excel Discussion (Misc queries) | |||
Fields in recordset from Access with value Null (empty fields) | Excel Programming | |||
averaging 32 fields | Excel Worksheet Functions | |||
PivotTable (blank) cells won't display NULL! | Excel Programming |