+ Reply to Thread
Results 1 to 11 of 11

Return value based on last date entered

  1. #1
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Return value based on last date entered

    Hi,

    This is my first post to this forum. I have a question. How do I return a value from another sheet based on two conditions.


    Return the most recent Qty (by date & Colour) from sheet2


    (sheet1)
    Colour Qty
    red << formula to return 765
    green << formula to return 65
    blue << formula to return 855
    white << formula to return 86
    orange << formula to return 83
    black << formula to return 3


    (sheet2)
    Date QTY Colour
    02/12/2018 499 red
    02/12/2018 32 green
    02/12/2018 567 blue
    02/12/2018 234 white
    02/12/2018 12 orange
    02/12/2018 67 black
    25/04/2019 58 red
    25/04/2019 778 green
    25/04/2019 96 blue
    25/04/2019 457 white
    25/04/2019 368 orange
    25/04/2019 44 black
    03/09/2019 765 red
    03/09/2019 65 green
    03/09/2019 855 blue
    03/09/2019 86 white
    03/09/2019 83 orange
    03/09/2019 3 black



    Kind regards

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Return value based on last date entered

    Hi and welcome to the forum.

    Will your data on sheet two always be in date order like that?

    BSB

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,846

    Re: Return value based on last date entered

    Welcome to the forum!

    Are you wanting to return the value of the latest date per colour?

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Return value based on last date entered

    If your data will always be in that order (i.e. latest dates at the bottom of the data) then you could use something like this:
    =LOOKUP(2,1/(Sheet2!C$2:C$19=A2),Sheet2!B$2:B$19)
    See attached.

    If the data could be in another order then you'll need something different.

    BSB
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Re: Return value based on last date entered

    Hi and thank you for making me feel welcome,

    BadlySpelledBuoy - with some changes your formula has the makings of what I need. I need both ranges to be indefinite but am getting an error with this change =LOOKUP(2,1/(Sheet2!C$2:C=A2),Sheet2!B$2:B)

    AliGW - I had tried to include a sample workbook but was prevented from including it with my message as a new member I need to be posting for a few times first before I can do so.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Return value based on last date entered

    Maybe this?
    =LOOKUP(2,1/(Sheet2!C:C=A2),Sheet2!B:B)

    Or if calculating on entire columns causes you issues you could use dynamic named ranges to only include down to the last populated row...

    BSB

  7. #7
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Re: Return value based on last date entered

    The column on my working workbook are not beside each other colG and colK (both starting on reow5) on sheet2 . In sheet1 starting on row5 using colI for the formula and colO for the colour. I changed the formula form =LOOKUP(2,1..... to =LOOKUP(5,8.....

    Am I correct to assume 2 represents the 2nd row and 1 is cola

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Return value based on last date entered

    Quote Originally Posted by gotroots View Post
    Am I correct to assume 2 represents the 2nd row and 1 is cola
    Incorrect. Have a look at the link below which will explain how it works.
    https://www.exceltip.com/excel-formu...ing-value.html

    You just need to change the column references to suit your data layout. Don't worry about row references.

    If you're still stuck then click "Go Advanced" below your reply then scroll down and click on "Manage Attachments" to open the upload window.
    The paperclip icon doesn't work for attaching files.

    BSB

  9. #9
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Re: Return value based on last date entered

    Success! your link explaining how it all works was a great help, thanks.

    Next time I need help I will attach an excel file as you both have instructed for me to do.

    Cheers!

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Return value based on last date entered

    Happy to help

    BSB

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,846

    Re: Return value based on last date entered

    Quote Originally Posted by gotroots View Post
    AliGW - I had tried to include a sample workbook but was prevented from including it with my message as a new member I need to be posting for a few times first before I can do so.
    There is no restriction on new members posting attachments - instructions about how to do so we’re given in post #2. New members are not permitted to post links, however.

+ 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. return last value before a date entered
    By steddas in forum Excel General
    Replies: 4
    Last Post: 03-07-2018, 10:02 AM
  2. Return a the latest Valeu (TEXT) entered based on a criteria
    By asantos80 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-05-2017, 02:44 PM
  3. Return Empty Cell When No Date is Entered?
    By jfezell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-25-2016, 06:19 PM
  4. Replies: 2
    Last Post: 05-07-2015, 04:38 PM
  5. Replies: 14
    Last Post: 08-21-2012, 02:17 PM
  6. Replies: 6
    Last Post: 04-21-2010, 11:59 AM
  7. Replies: 0
    Last Post: 05-25-2009, 06:58 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