+ Reply to Thread
Results 1 to 10 of 10

match numbers based on conditions and show the difference

  1. #1
    Registered User
    Join Date
    04-23-2017
    Location
    LONDON, ENGLAND
    MS-Off Ver
    PRO PLUS 2016
    Posts
    12

    match numbers based on conditions and show the difference

    i am making a personal stock keeping workbook. i get packages of different materials containing items of different weights. like i get a box of copper tubes containing 10 tubes each having different weight. like wise for iron and other materials.

    now i have made a sheet where i feed the name of item using vlookup and the enter the details of tubes in each package. a similar sheet for tubes sold. i am looking for a formula which would reference the inward sheet, sort all data for one particular product like copper, take all the different weights and then subtract the ones in the outward sheet and display each individual weight in the stock in hand in a separate sheet.

    each product will be entered on daily basis so a certain product will have multiple entries in both inward and outward sheet in no particular sequence with different dates and different weights. the formula should be able to generate the stock in hand on the fly for each product by comparing both inwards and outwards as and when data is entered in inward or outward sheet.

    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: match numbers based on conditions and show the difference

    This proposed solution employs two helper columns (which may be hidden for aesthetic purposes), one on the inward sheet and one on the outward.
    The formula that populates the helper column (match) on the inward sheet is: =IF(H8="","",ROW()-7)
    The array entered formula* that populates the helper column (match) on the outward sheet is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note: on both the inward and outward sheets the formulas that populate columns E and G have been modified.
    The array entered formulas* that populates the columns on the Stock In Hand sheet are all similar to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formulas are activated by simultaneously pressing the Ctrl, Shift and Enter keys while the cell is in edit mode.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    04-23-2017
    Location
    LONDON, ENGLAND
    MS-Off Ver
    PRO PLUS 2016
    Posts
    12

    Re: match numbers based on conditions and show the difference

    Quote Originally Posted by JeteMc View Post
    This proposed solution employs two helper columns (which may be hidden for aesthetic purposes), one on the inward sheet and one on the outward.
    The formula that populates the helper column (match) on the inward sheet is: =IF(H8="","",ROW()-7)
    The array entered formula* that populates the helper column (match) on the outward sheet is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note: on both the inward and outward sheets the formulas that populate columns E and G have been modified.
    The array entered formulas* that populates the columns on the Stock In Hand sheet are all similar to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formulas are activated by simultaneously pressing the Ctrl, Shift and Enter keys while the cell is in edit mode.
    Let us know if you have any questions.
    first of all thanks a lot. the output works as expected

    but in doing so it breaks a few things, namely

    1) when i enter a item number in column D it used to display the name of the product from pid master using vlookup automatically. now its not working
    2) When there was a entry in the column E column G used to start totally automatically from the blank cell in column H till the last blank cell. Its also not working anymore.

    can you please find a fix for the same

    thanks a ton!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: match numbers based on conditions and show the difference

    Point one seems to remedied by modifying the formula in E8 and down so that it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Point one seems to remedied by modifying the array entered formula in G8 and down so that it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.

  5. #5
    Registered User
    Join Date
    04-23-2017
    Location
    LONDON, ENGLAND
    MS-Off Ver
    PRO PLUS 2016
    Posts
    12

    Re: match numbers based on conditions and show the difference

    Quote Originally Posted by JeteMc View Post
    Point one seems to remedied by modifying the formula in E8 and down so that it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Point one seems to remedied by modifying the array entered formula in G8 and down so that it reads:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    your solution fixes the problems i mentioned but breaks the stock output in stock in hand sheet!!!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: match numbers based on conditions and show the difference

    I am not able to replicate that. I put the number 3 in Inward!D25 and 11.25 in H25 and it shows up as the third value in the Aluminum Tube column on the Stock in Hand sheet. I then placed the value 3 in Outward!D25 and the value 11.11 in H25. That resulted in leaving the values 13.25 and 11.25 in the Stock in Hand sheet. Could you upload a sample of your file showing the issue that you have encountered?

  7. #7
    Registered User
    Join Date
    04-23-2017
    Location
    LONDON, ENGLAND
    MS-Off Ver
    PRO PLUS 2016
    Posts
    12

    Re: match numbers based on conditions and show the difference

    here is my file with your formula applied. it does not update the stock in hand sheet
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: match numbers based on conditions and show the difference

    Try this and see if the issue is fixed.
    Let us know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-23-2017
    Location
    LONDON, ENGLAND
    MS-Off Ver
    PRO PLUS 2016
    Posts
    12

    Re: match numbers based on conditions and show the difference

    Quote Originally Posted by JeteMc View Post
    Try this and see if the issue is fixed.
    Let us know if you have any questions.
    i tried the file u posted. seems the stock in hand sheet is getting updated from values till row 25 only in both inward and outward sheets. as soon as i post anything below row 25, it stops getting updated.

    the formula in stock in hand sheet is matching rows 8 to 25 only!
    Last edited by coolmob; 04-28-2017 at 01:23 PM.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: match numbers based on conditions and show the difference

    You could modify the array entered formulas* on the Stock in Hand sheet columns B, D and F row 6 and down to fit the anticipated range such as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note: In the file attached to post #8 the highlighted values were all 25. 1000 is just an arbitrary number, you could choose any number up to the maximum number of rows (may cause calculations to take longer) in the version of Excel that you are using.
    *Remember to activate the formula by simultaneously pressing the Ctrl, Shift and Enter keys after making changes and before copying down the column.
    Let us know if you have any questions.

+ 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: 2
    Last Post: 06-18-2016, 11:17 AM
  2. How to show a positive difference between two numbers
    By tom hatten in forum Excel General
    Replies: 4
    Last Post: 03-18-2015, 11:44 AM
  3. [SOLVED] How to find the difference betwwen two rows based on conditions
    By Thinker8 in forum Excel General
    Replies: 11
    Last Post: 11-08-2013, 04:32 AM
  4. Show Difference of sheet1-sheet2 in sheet3 if items match?
    By nyichiban in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2013, 04:03 PM
  5. Insert numbers of based upon difference of two numbers
    By excellentlearner in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2012, 05:54 PM
  6. Show Value for Match w/2 Cell Conditions
    By bdb1974 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-24-2009, 01:11 PM
  7. [SOLVED] Show % Difference between two numbers
    By Jana in forum Excel General
    Replies: 7
    Last Post: 02-03-2006, 03:20 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