+ Reply to Thread
Results 1 to 7 of 7

Matching different rows with Changing criteria

  1. #1
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Matching different rows with Changing criteria

    Good morning all!

    I have a problem I've been wracking my brain wit for days now. I will upload a screen capture so that i can explain myself better than the title.

    Capture.JPG

    basically what you can see here is that i have made a table that has the current date, and the times of particular loads I am going to ship out. The part numbers in column D repeat because they get sent out on several loads a day. To the right is an an example of a part number and its total inventory at that moment. I've been trying to take that total number, and subtract from it in column F to show the remaining inventory of that part (where the xx are). my problem is that every time i refresh the ODBC query the sheet changes. Lines disappear as loads go out, different part numbers pop up with different times so no row will ever be the same after a refresh. The exception will be column F will have a static list of ALL part numbers, and their total quantity. Only the "total inv." in column H will change as we ship or make more parts. I have filled up the entire formula bar using SUMIFS and IF and MATCH and chaining IFERROR together and i cannot get it to be dynamic in any way. Any and all help here is greatly appreciated!!!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Matching different rows with Changing criteria

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Matching different rows with Changing criteria

    Thanks John,

    I have uploaded an example book with a before and after. Obviously the data in column L was done manually because I dont have a formula for it yet. My problem is that i not only need to make a formula to do that, but to do it manually. "diamond" will come up in different cells depending on if it is going out that day or
    how many times it goes out. so diamond starts at 500 and i ship 43, so it should show 457 left in column L. And so on.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Matching different rows with Changing criteria

    I can use the formula =IF($J10=$N2,$O2-$K10,"") in cell L10 and it works, but it only works that one time, for that specific name (diamond). If i refresh the page and J10 is garnet instead of diamond, it wont work because it is pointing at N2 which is diamond so it will just display 0. it is confounding.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Matching different rows with Changing criteria

    In L4

    =IFERROR(INDEX($O$2:$O$3,MATCH($J4,$N$2:$N$3,0))-SUMIF($J$4:J4,J4,$K$4:K4),K4)

    Copy down

    If no match i.e not in your table in N:O, the result is the value in K.

    If you want result to be blank then

    =IFERROR(INDEX($O$2:$O$3,MATCH($J4,$N$2:$N$3,0))-SUMIF($J$4:J4,J4,$K$4:K4),"")

  6. #6
    Registered User
    Join Date
    11-16-2017
    Location
    Ohio, United states
    MS-Off Ver
    2013
    Posts
    41

    Re: Matching different rows with Changing criteria

    Thank you John!

    I hate how once you see a solution its obvious that it is the perfect fit haha. i am going to have to ready up on the MATCH and INDEX pairing that seems to be pretty powerful. I would never have thought of it.


  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Matching different rows with Changing criteria

    All part of a (continuing) learning curve: we have all been there at some point.

    Glad to have helped.

+ 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] Matching criteria in different rows
    By pxtan in forum Excel General
    Replies: 3
    Last Post: 04-21-2016, 04:10 PM
  2. Copying partial rows with matching criteria using VBA
    By Ezzard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2015, 02:18 PM
  3. [SOLVED] matching rows based on 2 criteria
    By stribor40 in forum Excel General
    Replies: 11
    Last Post: 09-10-2014, 10:25 PM
  4. [SOLVED] Linest of rows matching criteria
    By RodGob in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2013, 05:50 AM
  5. [SOLVED] Hide rows not matching criteria
    By Hello Shell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-12-2013, 11:23 PM
  6. delete rows not matching certain criteria
    By sanketgroup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2011, 04:04 PM
  7. Identify rows matching certain criteria
    By Daz783 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-13-2010, 10:04 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