+ Reply to Thread
Results 1 to 9 of 9

Look up a value and recall previous date that value appeared.

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    27

    Look up a value and recall previous date that value appeared.

    I searched for a solution to my problem and there's a couple that are related but I couldn't seem to get any to work for my situation. Doesn't appear to be that hard to figure out, but I don't have enough Excel-Fu to figure my way around this problem.

    I'm creating a call log and want to set it up so that when I input a previously added value (TWO#), it will look up the last date that the TWO# was called.

    In the attached spreadsheet, my desired values are highlighted in Yellow. Highlighted in Green is an example of the behavior I'm looking for. If a TWO# is referenced 3 times, I want the Previously Called values to be representative of the dates the calls were made.

    For example:
    1) On 3-1-15 I call TWO# 111
    2) On 3-3-15 I call TWO# 111 again, previously called value = 3-1-15
    3) On 3-5-15 I call TWO# 111 a third time, previously called value = 3-3-15
    I want the value on line 2 to stay the same, regardless of any future calls made.

    Any help with this would be great, thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Look up a value and recall previous date that value appeared.

    Try this formula in F2 and copy it down

    =IF(COUNTIF(E$2:E2,E2)=1,"New",INDEX(A$2:A$13,MATCH(E2,$E$2:$E$13,0)))

    Format cells as Date
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    02-05-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    27

    Re: Look up a value and recall previous date that value appeared.

    It's close, but not exactly what I'm looking for.

    It's good when an item is marked as "New" and the first time it shows up as a duplicate, but in my sample worksheet, your formula leaves cell F13 as "3-3-15" when it should really be displaying "3-8-15" as 3-8-15 was the previous date in which TWO# 123 was called.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Look up a value and recall previous date that value appeared.

    Let's see if this one will do better

    =IFERROR(IF(COUNTIF(E$2:E2,E2)=1,"New",IF(COUNTIF(E$2:E2,E2)=2,INDEX($A$2:$A$13,MATCH(E2,$E$2:$E$13,0)),INDEX($A$2:$A$13,IF(COUNTIF(E$2:E2,E2)=3,MATCH(E2,$E$2:$E$13))))),"")

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    27

    Re: Look up a value and recall previous date that value appeared.

    It worked well in the example that I attached, but it still has some instability. If you erase all of the numbers that I put in for column E and replace them with any other numbers, it still has a hard time pulling the most recent date. Also, in your latest post, I see that you have it set up to work with up to 3 instances of a number, but there is a possibility of many more than 3 instances of a number to be in the entire spreadsheet. I would hate to think the only way to guarantee it works is to replicate an if statement for every reasonable chance of a certain TWO# appearing.

    We're getting closer though. I've messed around with it a little bit, and I'll keep trying my hand at it, but would still appreciate any help you can give.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Look up a value and recall previous date that value appeared.

    This one seems fine with the data I have. Give it a try.

    =IF(COUNTIF(E$2:E2,E2)=1,"New",SMALL(IF($E$2:$F$13=$E2,$A$2:$A$13),IF(COUNTIF(E$2:E2,E2)>2,2,COUNTIF(E$2:E2,E2)-1)))


    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Look up a value and recall previous date that value appeared.

    Here's a non array formula solution, it requires that you have a non data row above your data. In this case your row 1 which has labels not data. Notice how part of the formula references row 1, this is not by accident.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Look up a value and recall previous date that value appeared.

    Here's another non-array.....same non-data row issue.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-05-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    27

    Re: Look up a value and recall previous date that value appeared.

    Sorry for having to revive an old thread, haven't been able to get on for a hot minute. Used skywriter's solution and it works flawlessly. Really appreciate the assistance!

+ 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: 0
    Last Post: 02-25-2015, 01:02 PM
  2. List Box to recall previous entered values
    By pfeifferjoey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2014, 11:34 AM
  3. [SOLVED] Find latest date when the name appeared either formula or vba multiple sheets
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2014, 08:24 PM
  4. Replies: 0
    Last Post: 05-30-2013, 07:50 PM
  5. create macro to delete row with a date previous to current date
    By laserk7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2008, 12:36 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