+ Reply to Thread
Results 1 to 14 of 14

Calculation including blank cells in a pivot table

Hybrid View

Saturn Calculation including blank... 03-04-2012, 04:12 AM
dilipandey Re: Calculation including... 03-04-2012, 04:37 AM
Saturn Re: Calculation including... 03-04-2012, 05:06 AM
Fotis1991 Re: Calculation including... 03-04-2012, 05:13 AM
dilipandey Re: Calculation including... 03-04-2012, 05:15 AM
Saturn Re: Calculation including... 03-04-2012, 05:31 AM
dilipandey Re: Calculation including... 03-04-2012, 05:35 AM
Fotis1991 Re: Calculation including... 03-04-2012, 05:35 AM
ptm0412 Re: Calculation including... 03-04-2012, 05:44 AM
Saturn Re: Calculation including... 03-04-2012, 05:59 AM
ptm0412 Re: Calculation including... 03-04-2012, 06:11 AM
Saturn Re: Calculation including... 03-04-2012, 07:07 AM
Fotis1991 Re: Calculation including... 03-04-2012, 10:04 AM
ptm0412 Re: Calculation including... 03-05-2012, 10:55 AM
  1. #1
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    287

    Calculation including blank cells in a pivot table

    Please see the attached workbook.

    In cell S4 I am calculating the index for all 3 categories. (The way I do this is not the
    issue/question in this case).

    The source tabel (to the left) is originally a pivot table.

    Sometimes the one or two of the ILY-cells are blanc and then I am facing a problem
    in the calculation in cell S4. (#DIV/0!)

    How can I come around this problem ?
    Attached Files Attached Files
    Last edited by Saturn; 03-10-2012 at 06:07 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Calculation including blanc cells in a pivot table

    Hi Saturn,

    I would suggest you to do little research on below options:-

    One is two use GetPivotData function....

    Another is two use formula like... =IF(isblank(e4),"",e4)...

    If you face any issues, post the sample file with pivot. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    287

    Re: Calculation including blanc cells in a pivot table

    Thanks. I have tried the ISBLANK and variances of 'IF/OR/AND' but I am stuck.
    Any others who have suggestions for solving this problem?

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculation including blanc cells in a pivot table

    Hi

    You can try this.

    =IF(OR(E4="";I4="");"";(D4+F4+H4) / (D4/(E4/100)+F4/(G4/100)+H4/(I4/100)) * 100)


    Hope to helps you.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Calculation including blanc cells in a pivot table

    Hi Saturn,

    I would like to give a try to GetPivot, please upload a sample file. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  6. #6
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    287

    Re: Calculation including blanc cells in a pivot table

    Hi Fotis191 and dilipandey
    Thanks a lot to both of you.

    The suggestion to dilipandy doesn't work as I have tried to blank out E4, G4 and I4 in the attached file.
    So: one or two of either E4, G4 and I4 might be blank, and then I want that (blank) cell to be ignored when the calculation is done.
    I can't produce a sample with the pivot table. Pivot table or not, the calculation is done outside the PT.

    Saturn

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Calculation including blanc cells in a pivot table

    Hi Saturn,

    GetPivot requires Pivot table, hence I asked for the same. If you are unable to produce the pivot, then I would suggest you to go with the solution provided by Fotis and enhance / upgrade the same. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculation including blanc cells in a pivot table

    This works for you?

    =IF(OR(E4="";I4="";G4="");"";(D4+F4+H4) / (D4/(E4/100)+F4/(G4/100)+H4/(I4/100)) * 100)

    Change semi-colons to gomma, if you have to do it.

  9. #9
    Forum Contributor ptm0412's Avatar
    Join Date
    04-16-2008
    Location
    Vietnam
    MS-Off Ver
    Office 2003 and 2007
    Posts
    129

    Re: Calculation including blanc cells in a pivot table

    I think this formula has the same result:

    =IF(E4*G4*I4=0,"",(D4+F4+H4) / (D4/E4+F4/G4+H4/I4))

    I wonder why we have to devide all by 100 then multiply by 100?

  10. #10
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    287

    Re: Calculation including blanc cells in a pivot table

    According to this calc. the result is blank if E4 and/or G4 and/or I4 is blank. Previously it become #DIV/0!
    I have to multiply and divid with 100 to have the result be shown as an index. (100 is same result as last year, 200 = double, 50 = half...)

  11. #11
    Forum Contributor ptm0412's Avatar
    Join Date
    04-16-2008
    Location
    Vietnam
    MS-Off Ver
    Office 2003 and 2007
    Posts
    129

    Re: Calculation including blanc cells in a pivot table

    Well, it is acording to you to "show as an index", but does my formula work?

  12. #12
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    287

    Re: Calculation including blanc cells in a pivot table

    Hi ptm0412

    No, unfortunally it doesn't. One or more blank cells (E/G/I) results in a 'blank' result.

    Saturn

  13. #13
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculation including blanc cells in a pivot table

    @ptm0412

    ...I wonder why we have to devide all by 100 then multiply by 100?
    I angree with you, but i don't care! If OP wants this,then OK....!

    @Saturn

    The formula that i offered you, does,all these that you are looking for...!

    So, i think that you are looking for something else....but you do not explain to us...what is this.....!

  14. #14
    Forum Contributor ptm0412's Avatar
    Join Date
    04-16-2008
    Location
    Vietnam
    MS-Off Ver
    Office 2003 and 2007
    Posts
    129

    Re: Calculation including blanc cells in a pivot table

    Dear Fotis,
    That question I ask Saturn and he replied already. I am sorry if you misunderstand that I asked you.

    Dear Saturn,
    May your need is:

    IF(E4*G4*I4=0,"",(D4*(E4>0)+F4*(G4>0)+H4*(I4>0))/(IF(E4>0,D4/E4,0)+IF(G4>0,F4/G4,0)+IF(I4>0,H4/I4,0)))


    It means the formula ignore blank cells within E4, G4, I4, and calculate the rests.

    (Divide by and multiply with what you want)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1