+ Reply to Thread
Results 1 to 4 of 4

How to replace month with cell ref.

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    Copenhagen
    MS-Off Ver
    201, 2013, 365
    Posts
    42

    How to replace month with cell ref.

    In this formel I am trying to cvhange the month at the end [January] to link to cell J6 -

    Works
    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&[January]")

    Tired:
    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&;J6")
    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&;"J6"")
    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&,;J6")
    Last edited by Pepe Le Mokko; 10-29-2019 at 03:28 AM. Reason: Title changed. Removed unnecessary part

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Question: How to replace month with cell ref.

    Without reference to a sample workbook, your formula is almost impossible to interpret. I suggest that you attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,420

    Re: Question: How to replace month with cell ref.

    There’s a rogue comma right at the end after the final ampersand:

    1st Qtr].&,;J6")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,265

    Re: How to replace month with cell ref.

    If J6 contains January, then you need:

    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&["&J6&"]")

    If it contains [January] then use:

    =GETPIVOTDATA("[Measures].[GWPremium]";'Name'!$A$16;"[Agent].[Main agent Hierarchy]";"[Agent].[Main agent Hierarchy].[Main agent].&[Name A/S]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)]";"[Calendar Fiscal].[Calendar Fiscal (Year-Quarter-Month)].[Fiscal year].&[2019].&[1st Qtr].&"&J6)
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 07-02-2019, 08:55 AM
  2. replace Today() with End of Month help Please
    By Hassan1977 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2015, 06:36 AM
  3. Replies: 7
    Last Post: 08-14-2015, 11:25 AM
  4. Quick VBA Question: Identify a cell and replace it's value
    By AnArtfulDodger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2014, 12:45 PM
  5. Replace value in cell when value for next month are added
    By johrm50 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2012, 03:44 PM
  6. [SOLVED] Pivot: Replace month numbers with month names and sort by fiscal year
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2011, 02:13 PM
  7. [SOLVED] Excel Cell.Replace question
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2005, 03:05 PM

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