+ Reply to Thread
Results 1 to 5 of 5

Formula for last recorded date

  1. #1
    Registered User
    Join Date
    10-08-2018
    Location
    Vietnam
    MS-Off Ver
    Excel 2013
    Posts
    12

    Formula for last recorded date

    Hey friends!

    I have an issue finding a formula that helps enter the last recorded date into a column.

    Attached is an example of the sheet I am focusing on. The table headers that are in blue represents a PivotTable that I have created to filter the data from a larger pool of data.

    The cells highlighted in yellow are where I want the latest date recorded to be entered.

    Please refer to sheet 2 in the example book that I have provided. Sheet 2 is when I use the PivotTable to show the dates of the person that claimed a gift. I would like to transfer the last date (highlighted in yellow) to the cells highlighted in yellow.

    Thank you for reading and helping! I know the way I explain might be confusing so just post a comment on the thread and I will reply asap. Once again, thank you so much!
    Attached Files Attached Files

  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,933

    Re: Formula for last recorded date

    Hi, welcome to the forum

    It will be hard to ID the dates you want, because of the way you have the data laid out - you need to have the Label in 1 column, and the date in another column
    Also, your dates are not really dates (to excel), they are text looking like a date and we will need to convert them

    Would you be OK with adding a helper to put the labels in each row?

    If so, use this in L4
    L4=IF(ISERROR(DATE(RIGHT(A4,4),MID(A4,4,2),LEFT(A4,2))),A4,L3)
    copied down.
    To convert the date...
    M4=IFERROR(DATE(RIGHT(A4,4),MID(A4,4,2),LEFT(A4,2)),"")
    copied down

    Then to get the latest date for each label...
    G4=MAX(IF(Sheet2!$L$4:$L$25=Sheet1!A4,Sheet2!$M$4:$M$25))
    ARRAY entered ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    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 Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Formula for last recorded date

    ARRAY formula in G4 of Sheet2 then copied down.

    =IF(ISERROR(1*$A4),INDEX($A5:$A$25,IFERROR(MATCH(1,--ISERROR(1*$A5:$A$25),0)-1,ROW($A$25)-ROW())),"")

    In G4 of Sheet1 then copied down.

    =IFERROR(AGGREGATE(15,6,(Sheet2!$G$4:$G$25)/(Sheet2!$A$4:$A$25=Sheet1!$A4),1),"")

    How ARRAY formula is entered

    Paste Formula in the cell.
    Press F2
    Hold Shift+ Ctrl Keys and hit Enter key.
    Now the formula is surrounded by {} by excel.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Registered User
    Join Date
    10-08-2018
    Location
    Vietnam
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Formula for last recorded date

    FDibbins:

    Thank you very much. It works for the example file I have created. I will be trying to apply this to the rest of the data I have.

    Brian

  5. #5
    Registered User
    Join Date
    10-08-2018
    Location
    Vietnam
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Formula for last recorded date

    kvsrinivasamurthy:

    Thank you!

+ 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: 4
    Last Post: 07-18-2018, 12:30 PM
  2. [SOLVED] Userform displays saved recorded dates with month and date in reverse order
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2015, 08:34 AM
  3. Recorded Macro changing date format
    By cindywylie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 03:56 PM
  4. [SOLVED] Recorded Formula Macro Won't run
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2014, 01:22 PM
  5. [SOLVED] Recorded Pivot Table Macro Doesn't Do What I Recorded!
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 11:01 AM
  6. Macro behaves differently then when recorded and stuffs dates (or date formats)
    By stephenb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2005, 10:35 PM
  7. changing a recorded macro - date problem....
    By Daan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-23-2005, 12: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