+ Reply to Thread
Results 1 to 14 of 14

Lookup with criteria / Index match (?) / Using dates

  1. #1
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Lookup with criteria / Index match (?) / Using dates

    Hello guys
    I´m not sure which functions to combine to the desired result. I've uploaded the sheet, it is in portuguese but that won't matter much I hope, I'll explain the best I can.

    What I need to do is:

    On the third tab (Cobrança), column H (Valor unitario de compra), I need to do a special lookup from the second tab (Valores ENTRADA + SAIDA), bringing me the value from column O (Saldo V. Unitario).

    The conditions are:

    1)Matching the product from column D from the third tab with the second tab (column E)
    2)Must search only from rows with the string "compra" on column B from the second tab
    3)As the value searched is dynamic, the date from second tab must be the LAST, EQUAL OR PRIOR, the one from the third column.

    Example:

    The first data on the third tab is hashi sticks sold on 16/09. The value searched on second tab is O160, because its the unit price of the product on its last purchase, 21/08, prior to the sale's date (row 160).


    This seems a complex task to me so Im not sure how to begin solving it.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Lookup with criteria / Index match (?) / Using dates

    Hi,

    you could try, in dates are in ascending order

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope it helps
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    Hello canapone
    Just read your answer, because I created this thread on a late friday :P

    I don't fully understand what you tried to do with the formula, and the syntax is quite odd so could you give me any more information so I can put it to work?

    Thanks
    Last edited by RenanCip; 10-27-2014 at 10:49 AM.

  4. #4
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    If anyone else could give me an opinion about this:

    Please Login or Register  to view this content.
    My attempt looks something like the formula above, however it errors out and I dont know how to include my condition 2)

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Lookup with criteria / Index match (?) / Using dates

    Hi again,

    please see formulae in the attached file.

    Cheers
    Attached Files Attached Files
    Last edited by canapone; 10-27-2014 at 11:51 AM.

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup with criteria / Index match (?) / Using dates

    Hi try this Untested though

    Please Login or Register  to view this content.
    Last edited by Vikas_Gautam; 10-27-2014 at 12:13 PM.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  7. #7
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    double post

  8. #8
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    How do I guarantee the condition ('Valores ENTRADA + SAÍDA'!C2:C5000<=Cobrança!B2)will bring me the last date prior to the one I searched?

    It´s the only thing not working properly
    Last edited by RenanCip; 10-27-2014 at 12:14 PM.

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup with criteria / Index match (?) / Using dates

    Deleted.. Duplicate post...
    Last edited by Vikas_Gautam; 10-27-2014 at 10:01 PM.

  10. #10
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    Both formulas work to some extent, but the thing is ('Valores ENTRADA + SAÍDA'!$C$2:$C$474<=B2) makes it search for the wrong value, probably because it partially meets my needs. It shouldn´t be only an older date, it must be the last unit value of my inventory product before I make a sale. The unit value can change a lot, for example:

    10/10 - Bought 10 units for $10 (I have 10 units, value of my units in stock = 10)
    11/10 - Bought 5 units for $20 from another seller ( I have 15 units, value of my units in stock = 13,33)
    12/10 - I resell some of these items for $30

    What I actually profit is the difference 30-13,33 and not 30-10. Thats why I need it to search for the LAST DATE of purchase, currently the formula with <= is not specifying this

  11. #11
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    I was wondering if any "count" function would help stablish this final condition

    Or maybe somehow include an extra date condition, (its still <=B2 on the example, but also the latest one, with a maximum function or something)

    Any ideas will be greatly appreciated
    Last edited by RenanCip; 10-27-2014 at 01:29 PM.

  12. #12
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    It seems the match formula won't allow a max or countif formula as a fourth criteria added to the ones we already have, it only compares cells, is it correct?

    Still need help please

  13. #13
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup with criteria / Index match (?) / Using dates

    For last match, try this ( Untested though )
    Formula: copy to clipboard
    Please Login or Register  to view this content.






    Regards,
    Last edited by Vikas_Gautam; 10-27-2014 at 10:08 PM.

  14. #14
    Registered User
    Join Date
    09-25-2014
    Location
    Sao Paulo, Brazil
    MS-Off Ver
    2013
    Posts
    24

    Re: Lookup with criteria / Index match (?) / Using dates

    Thank you for your reply, but it doesn´t work

    Also, how is the "Row Criteria" choosing the last date of purchase like I explained above, while considering also<= B2, and not only selecting one row before the last of the table?

+ 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: 6
    Last Post: 04-30-2014, 02:42 AM
  2. V-Lookup, Match or Index when searching between two dates
    By Simonekeise in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2013, 04:12 AM
  3. Multiple Criteria Lookup/Match/Index
    By Kasz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 09:30 AM
  4. Help with Lookup/match/index with 2 criteria.
    By Fizziii in forum Excel General
    Replies: 5
    Last Post: 04-28-2011, 10:00 AM
  5. Lookup Or Index, Match then Sum with several criteria.
    By borissinga in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2010, 08:31 AM

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