+ Reply to Thread
Results 1 to 10 of 10

Function indicating last use of 2 different values

  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    S
    MS-Off Ver
    Excel 2010
    Posts
    19

    Function indicating last use of 2 different values

    Column A contains dates. Columns B to D are exercises. Whenever I complete an exercise on a certain date, I either input 1 or 2 in the respective cell. For example, I do the exercise “back” on 9/7/2015, then I insert 1 or 2 in B6.

    What I need now are two separate functions for each exercise or columns. Each of these functions should indicate on which date I have last inserted either 1 or 2. So, if I insert 2 in column “back” on 9/7/2015, the function should yield 9/7/2015. If I insert 1 on 9/10/2015 in column “back”, it should yield 9/10/2015. I only want one column for each exercise.

    The function in row 2 has served me well while I only used a single value but does not work with multiple values (e.g. 1 and 2) in one column.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Function indicating last use of 2 different values

    Try this in B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jacc; 10-24-2015 at 06:42 PM.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    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: Function indicating last use of 2 different values

    If you are ONLY entering 1 or 2, then pretty much, you are looking for the very last entry in that column. Try this B2, copied across...
    =INDEX($A$4:$A$14,MATCH(0,B$4:B$14,-1))
    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

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Function indicating last use of 2 different values

    A little bit shorter version here:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-17-2014
    Location
    S
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Function indicating last use of 2 different values

    Thanks for the help. I've attached another sample file.

    Quote Originally Posted by Jacc View Post
    Try this in B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I've entered this formula in B2. As you can see, it correctly states the date of the last entry with the value 1. However, I need the same formula now displaying the last entry for the value 2 in the same column.

    Quote Originally Posted by FDibbins View Post
    If you are ONLY entering 1 or 2, then pretty much, you are looking for the very last entry in that column. Try this B2, copied across...
    =INDEX($A$4:$A$14,MATCH(0,B$4:B$14,-1))
    I've used your formula in C2. It yields 42261 as a result, which does not help.

    Quote Originally Posted by Jacc View Post
    A little bit shorter version here:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    See D2. Yields 42256. Maybe a problem with the format in the date cells?
    Attached Files Attached Files

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function indicating last use of 2 different values

    I didn't download your file.

    Try formatting the formula cells as Date.

    In Excel dates are really just numbers formatted to look like dates.

    The numbers you see, 42261 and 42256, are called the date serial numbers. When formatted as Dates, you get:

    42261 = 9/14/2015
    42256 = 9/9/2015

    The date serial number is the count of days starting from a base date. In Windows Excel the default base date is January 1, 1900. So, January 1, 1900 is date serial number 1.

    Jan 1 1900 = date serial number 1
    Jan 2 1900 = date serial number 2
    Jan 3 1900 = date serial number 3
    Jan 4 1900 = date serial number 4
    Jan 5 1900 = date serial number 5
    etc
    etc
    Jan 1 1975 = date serial number 27395
    Jan 1 2000 = date serial number 36526
    Jan 1 2015 = date serial number 42005

    You can see the date serial number by entering some date in a cell and then changing that cells format to General or Number.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    03-17-2014
    Location
    S
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Function indicating last use of 2 different values

    Thanks for the clarification regarding the date format.

    So the only issue remaining now is that all functions yield the last value entered in a column, be it 1 or 2. However, I need one function reading ONLY the entries with value 1 and another function reading ONLY the entries with value 2. Hope that makes sense.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Function indicating last use of 2 different values

    So B2 for 1 and B3 for 2?

    B2=IF(MAX(INDEX($A$4:$A$14*(B$4:B$14=1),))=0,"",MAX(INDEX($A$4:$A$14*(B$4:B$14=1),)))

    Change 1 to 2 for B3
    Quang PT

  9. #9
    Registered User
    Join Date
    03-17-2014
    Location
    S
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Function indicating last use of 2 different values

    That's it! Works like a charm. Thanks to all the contributors.

  10. #10
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Function indicating last use of 2 different values

    Ah, two functions. Well then you can just split up mine, it is shorter.
    In B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In B3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jacc; 10-26-2015 at 05:08 AM.

+ 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: 1
    Last Post: 05-05-2014, 02:31 PM
  2. Indicating how many cells to sum up
    By calhawk01 in forum Excel General
    Replies: 4
    Last Post: 11-18-2011, 03:33 PM
  3. Formula indicating Expired
    By euwest30 in forum Excel General
    Replies: 1
    Last Post: 07-14-2010, 09:51 PM
  4. Need function for finding and indicating repeats/duplicates
    By CL39 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-20-2008, 01:30 PM
  5. [SOLVED] Formula indicating duplicate values in a range
    By Victoria in forum Tips and Tutorials
    Replies: 11
    Last Post: 02-09-2007, 06:53 PM
  6. I need a little help with comparing columns and indicating the mat
    By IFIXPCS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-22-2006, 01:10 PM
  7. Indicating Payment Due
    By nicholea in forum Excel General
    Replies: 2
    Last Post: 12-14-2005, 06:43 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