+ Reply to Thread
Results 1 to 15 of 15

Formula IF exist in Pivot Table field and in a Named Range

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Formula IF exist in Pivot Table field and in a Named Range

    Hi,

    I'm looking to do something here with a Pivot Table and a Named Range. I have multiple Pivot Table setup.

    Let say I have a field in my Pivot Table that can be A, B, C, D and E that return value from 1 to 100.

    I would like to Sum the value if the Pivot Table field name is include in the named range X.


    I attached an exemple.

    I really appreciate any help on this.

    Thanks !
    Attached Files Attached Files

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Do you want when the pivot field name is included in named ranges Project 1/2/3, then only pivot should consider those fields ?
    Or I am missing something here...


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Well, actually I need to do 2 things.

    1. Formula outside the Pivot Table refering to the Pivot. Something like : sumif pivot field name is included in named range X, then sum pivot table calculated field.


    2. (That was not the original post). VBA script that change all pivot table (that names start with Project1) filter to equal Named Range X.


    English isnt my first language. I'm sorry about error I may do.

    Is this clear?

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Not sure.. but if a pivot considers a column then it will show sum for all the present values in that column, unless you check them out using pivot filter
    Alternatively, you can edit your pivot data source itself to exclude those items which you don't want to consider .. hope I am on right track.


    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    No.

    I do not want to make any change on my Pivot Table.

    I want a formula to check in the Pivot Table for Project that are included in Named Range. For each Project found, sum the value of this project.

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Okay.. try below formula as I shown in green cells in attached pivot:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Attachment 228527


    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Invalid attachment specified.

    Can you try to upload it again please.

    Thank you !

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Okay.. trying to attach once again :-

    Test.xlsx


    Regards,
    DILIPandey
    <click on below * if this helps>

  9. #9
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Hi Sir,

    This is great. Thank you.

    Now is there a way to do this using Named Range? Because I got around 70 items in some project so doing it this way would give me a really long formula.

    So I would like to replace L12 and L13 by PROJECT_1 (Named Range).

    This is where Im getting trouble.

    Thank you again for your help.

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    So I would like to replace L12 and L13 by PROJECT_1 (Named Range).
    but I did not used them in the formula and if you meant i12 and i13, then I used them separately in formula and hence two names would be required.
    See the below formula where I demonstrated this with defined name as data1 and data2 :-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached:- Test (9).xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>

  11. #11
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Ok.

    But doing it this way is the same with or without names.

    I have +/- 70 data. I can't do them one by one.

    Is there a way to check if $E$*:$E$12 exist in NAMES, then sum the data.

    Regars,

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Is there a way to check if $E$*:$E$12 exist in NAMES, then sum the data.
    and those NAMES will be first defined by you only and then you can check if $E$*:$E$12 exists or not .. hence effort is there, either way.

    BTW, did you noticed the defined name which I used ?
    Press Ctrl + F3 to see the name and the logic as that one is dynamic name and you do not need to define them for every new range


    Regards,
    DILIPandey
    <click on below * if this helps>

  13. #13
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    It doesnt work.

    I uploader the test file. Check out the NAMES and how I would like to do it !

    Thank you again SIR.
    Attached Files Attached Files

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

    Re: Formula IF exist in Pivot Table field and in a Named Range

    As I said
    BTW, did you noticed the defined name which I used ?
    Press Ctrl + F3 to see the name and the logic as that one is dynamic name and you do not need to define them for every new range

    check my attachment which I uploaded in post#10.



    Regards,
    DILIPandey
    <click on below * if this helps>

  15. #15
    Registered User
    Join Date
    10-03-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Formula IF exist in Pivot Table field and in a Named Range

    Hi,

    I understand the Named Range you create.

    But if the Named Range is extended to 2 or more data, it doesn't work.

    In this exemple, I have 70 Data to look for.

    I dont want to do this 70 times : ($E$8:$E$81=data1)


    I may be wrong, but I dont think this is working with your exemple.


    Thanks again, SIR.
    Attached Files Attached Files

+ 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