+ Reply to Thread
Results 1 to 7 of 7

Enter specific data with multiple criteria

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Massachusetts,US
    MS-Off Ver
    Excel 2010
    Posts
    44

    Enter specific data with multiple criteria

    help.xlsx
    In the file that I attached there are two sheets 1 and 2 which have tables in them. What I want is for excel to look up each cell in sheet 1 Inventory column in sheet 2 Materialcode# and if it finds the number then I want it to look up dates closest to the start of the month of June in the rec'd date column, if it does find the date then it will put the number next to it from column lbs. rec'd, this number will be entered in sheet 1 cell b2 and so on under Starting Stock.
    It should look like this for Inventory number 300001. And if it says 0 for Entries then it would also say 0 for starting stock.

    Inventory__________Starting Stock
    300001____________14,000


    This would be the correct amount for that one.
    Last edited by JBeaucaire; 07-25-2012 at 05:08 PM. Reason: Corrected thread title to topic only, as per forum rules

  2. #2
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Enter specific data with multiple criteria

    see if this solves your requirement. this solution assumes that ALL of the dates in the RECEIVED DATE column on SHEET2 are, and will be, in ASCENDING order (oldest first, newest last). also, wherever you have "cancelled" in the DATE and LBS columns, the formula returns a zero (0). this is because excel considers text to be greater in value than numbers during comparative mathematical operations.

    also, the data formatting in your file is all over the place; some numbers in the Material Code columns are stored as numbers, certain others as text. also, there are several instances of blanks. these are key ingredients in the recipe for disaster in formulaic operations.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    Massachusetts,US
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Enter specific data with multiple criteria

    First of all thank you I appreciate you taking the time to do this, I'm very thankful. The formula some what works, but if you can explain to me how this formula work especially the index part I could fix it up my self.
    =IFERROR(N(INDEX(Sheet2!$C$1:$C$1000,MATCH(1,INDEX(--(Sheet2!$A$1:$A$1000&""=Sheet1!$A2&"")*--(Sheet2!$B$1:$B$1000>=DATE(2012,6,1)),0),0))),"-")
    Thank You once again!!!!!!

  4. #4
    Registered User
    Join Date
    07-11-2012
    Location
    Massachusetts,US
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Enter specific data with multiple criteria

    First of all thank you I appreciate you taking the time to do this, I'm very thankful. The formula some what works, but if you can explain to me how this formula work especially the index part I could fix it up my self.
    =IFERROR(N(INDEX(Sheet2!$C$1:$C$1000,MATCH(1,INDEX(--(Sheet2!$A$1:$A$1000&""=Sheet1!$A2&"")*--(Sheet2!$B$1:$B$1000>=DATE(2012,6,1)),0),0))),"-")
    Thank You once again!!!!!!

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Enter specific data with multiple criteria

    i think it might be easier for me to fix the formula than explain what it does . i do not mind explaining, it is just that i will have to type a lot, which i am not a huge fan of. if you would like to figure out for yourself, you can use the Evaluate Formula function in Excel (ALT > M > V).

    can you share with me what is it that "somewhat" works? i will attempt to draw up the update and hence, may be, indicate how this formula works...

    by the way, in that formula, you can drop the minus signs that i have inserted in two places (double negs, double unary as they are called).

  6. #6
    Registered User
    Join Date
    07-11-2012
    Location
    Massachusetts,US
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Enter specific data with multiple criteria

    Thank You for your effort in this but i was able to figure a simpler way of doing with no formula, but I do have a new post if you want to check it out.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter specific data with multiple criteria

    As a courtesy to those who helped and those who might research later, please post your solution to this thread, then select Thread Tools from menu above and set this topic to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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