Free Support Forum -

How to Avoid Div/0 Error in pivot table for average of 0 value data


In pivot table how to do average for the cells which contains 0.

pivotTable.AddFieldToArea(PivotFieldType.Data, 3);
pivotTable.DataFields[2].Function = ConsolidationFunction.Average;

I am getting Div/0 Error ..
I understand that 0/0 in Average is giving error.
I dont want display Div/0 Error in pivot table.
Instead of error .. I want to show a null value or 0 ..
Please help me ..



Well, I think this is now MS Excel works or calculates for 0/0 values. How could you do this (to fix div error (“0” or null instead of div error) for pivot table report data) to automatically perform your task. If you know, do let us know with template file we will check it soon.