+ Reply to Thread
Results 1 to 7 of 7

Formula to calculate number of months since last shipment (from pivot table data)

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    London, England
    MS-Off Ver
    Excel Professional Plus 2010
    Posts
    12

    Formula to calculate number of months since last shipment (from pivot table data)

    Hello! This is my first post...REALLY hope someone can help because I am completely stuck. I've attached a workbook. The issue is on the last tab ("Summary") in column D. I am trying to find a formula that will calculate the "months since last shipment". My shipment data is on the first tab and the pivot (from where I'm trying to get the "months since last shipment") is the second tab.

    So just to make sure I'm being clear, here is an example:
    I want to know how many months it's been since ABC Company has had a shipment. According to my pivot, the last was in April so I need "2" to populate on my summary tab.

    **Just FYI - this is a report with data up until June only, so June is my "current month" for the purpose of this excel. you can see in Z1 (on No. Shpmt tab) I have my current month identified.

    There is a formula in there currently (on summary page) that a colleague helped me create. It's obviously VERY wrong but I'm not sure why and if it's even the right direction to go in.
    Months since last shipment help.xlsx
    Please let me know if anyone can help! I'm completely lost.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formula to calculate number of months since last shipment (from pivot table data)

    Why is April 2 and not 3?
    If you want result 2 just add -1 on the formula:

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

  3. #3
    Registered User
    Join Date
    07-15-2013
    Location
    London, England
    MS-Off Ver
    Excel Professional Plus 2010
    Posts
    12

    Re: Formula to calculate number of months since last shipment (from pivot table data)

    Hi there,

    thanks for your reply! Yes, as mentioned, the report data is June so I'm always working one month in the rear...so in June it would be 2 months since the last shipment, not 3. Make sense?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formula to calculate number of months since last shipment (from pivot table data)

    So just change first match to your criteria:

    =MATCH("Jun-13",'No. Shpmt'!$B$4:$Y$4,0)-MATCH(LOOKUP(2,1/(OFFSET('No. Shpmt'!$B$4:$Y$4,MATCH(A5,'No. Shpmt'!$A$5:$A$1000,0),)<>""),'No. Shpmt'!$B$4:$Y$4),'No. Shpmt'!$B$4:$Y$4,0)

  5. #5
    Registered User
    Join Date
    07-15-2013
    Location
    London, England
    MS-Off Ver
    Excel Professional Plus 2010
    Posts
    12

    Re: Formula to calculate number of months since last shipment (from pivot table data)

    Just wanted to reply once again...you're a life saver!! This definitely worked. Thank you so much - I can't tell you how long I've been struggling with this.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formula to calculate number of months since last shipment (from pivot table data)

    See, it was easy

  7. #7
    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: Formula to calculate number of months since last shipment (from pivot table data)

    Quote Originally Posted by emdoak View Post
    I can't tell you how long I've been struggling with this.
    It's because you never heard of this forum.
    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.

+ 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. Displaying ALL months in Pivot table, even if there is no data
    By ahorwitz in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-23-2016, 12:09 PM
  2. Replies: 1
    Last Post: 02-16-2012, 10:03 PM
  3. Calculate formula in Pivot Table
    By a.hussain in forum Excel General
    Replies: 4
    Last Post: 02-08-2012, 09:59 AM
  4. [SOLVED] Pivot table blank cells show data deleted months ago!
    By vcard in forum Excel General
    Replies: 0
    Last Post: 04-25-2006, 04:30 PM
  5. Replies: 2
    Last Post: 08-02-2005, 04: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