+ Reply to Thread
Results 1 to 4 of 4

Formula to return most recent instance of value?

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    Glendale, Colorado
    MS-Off Ver
    Microsoft 365 Version 2501
    Posts
    57

    Formula to return most recent instance of value?

    Hello!
    I am attempting a cleanup of five fields in our animal shelter software, called Chameleon. For instance, one of the fields in Chameleon is Intake Type. In that field, the user must choose one of 12 different options such as stray, owner surrender, etc. for the animal in question. I'd like to know which of the 12 options have not been chosen by any users in the last five years, so I can delete the options that no one is using.

    I exported about 5 years of data from the software and included the intake date, which is about equal to the date last used for all fields being looked at. In the first tab is the last 5 years' data, called 2011-2016_Orig. The next tab is named after the fields, and contain the distinct options in each field- each option is shown once. So in Intake_Type there are 12 different choices a user can make. I'd love to be able to see the most recent date each option was used so I can see which options have not been used in a long time.

    Is there a VLOOKUP formula or something similar I can use to find the date each value in column A on tab two appears in tab one's data set? So for instance, what is the most recent date an animal was recorded as Stray in tab one Column B?

    Any help that can be offered is GREATLY appreciated, thank you for your help in advance!!

    Melissa
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Formula to return most recent instance of value?

    Give this a try in B2 of your Intake Type sheet:

    Note that this needs to be entered as an array formula, so when you've entered it, press Ctrl-Shift-Enter. You'll see curly brackets around it.

    =MAX(IF('2011-2016_Orig'!$B$2:$B$16628=Intake_Type!A2,'2011-2016_Orig'!$A$2:$A$16628))

    You can then copy it down to the other cells in column B. You'll need to format the column as dates.

    I noticed that the last three show as 01/01/1900 which means that this is returning a 0 (i.e. none found). You could clean this up with an IF statement on the above formula but I figured that if you're only using this to check data, you probably just need to know which ones have been used.
    Excel is a constant learning process and it's great to help each other. If any of us have helped you today, a click on the "reputation" star on the left is appreciated.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Formula to return most recent instance of value?

    Put this array* formula in B2 of Sheet2:

    =MAX(IF('2011-2016_Orig'!$B$2:$B$16628=A2,'2011-2016_Orig'!$A$2:$A$16628))

    Format the cell as a date, then copy down. Note the final 3 return zero as they are not present in your other sheet - this is interpreted by Excel as the zeroth of January 1900.

    *An array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), instead of the usual < Enter >.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    04-24-2014
    Location
    Glendale, Colorado
    MS-Off Ver
    Microsoft 365 Version 2501
    Posts
    57

    Re: Formula to return most recent instance of value?

    This works perfectly, thank you so so much!

+ 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. [SOLVED] Formula to return earliest and latest time.
    By Shellybelly in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-07-2014, 01:35 AM
  2. [SOLVED] formula to look up value and return the earliest date?
    By ea223 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2013, 08:27 PM
  3. Replies: 1
    Last Post: 01-26-2012, 07:16 AM
  4. Can Excel return the earliest date using =IF?
    By jareduk in forum Excel General
    Replies: 7
    Last Post: 04-01-2009, 04:59 AM
  5. Return the earliest day of a month
    By vickyho1008 in forum Excel General
    Replies: 1
    Last Post: 07-07-2008, 04:49 AM
  6. Vlookup to Return Earliest Date
    By marco168 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2007, 11:12 AM
  7. Return one instance using formula or filter
    By Pat in forum Excel General
    Replies: 1
    Last Post: 09-09-2005, 02: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