+ Reply to Thread
Results 1 to 4 of 4

Complex problem involving moving rows and returning different values from same criteria

  1. #1
    Registered User
    Join Date
    06-15-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2013
    Posts
    2

    Complex problem involving moving rows and returning different values from same criteria

    Hello brilliant Excel users, I have a bit of a complex problem that I need some help with. I use Excel 2013 to track my inventory. Sometimes I purchase the same item for different prices. An example of my "Current Inventory" spreadsheet is below:

    Item --------- Buy Price ---- Quantity
    Apple Ipod ------ 150 ---------- 1
    Apple Ipod ------ 175 ---------- 1
    Apple Ipod ------ 175 ---------- 1
    Electric Fan ------ 10 ---------- 1
    Electric Fan ------ 15 ---------- 1
    Electric Fan ------ 15 ---------- 1
    Apple Ipod ------ 125 ---------- 1

    When I buy multiple quantities of the same item (regardless of the "buy price"), I just create a new row for each individual item with a listed quantity of 1. With me so far? The next spreadsheet I use, "Sales", lists the item name and the quantity that I sold. An example of my "Sales" spreadsheet is below:

    Item ---------- Quantity Sold
    Apple Ipod ---------- 2
    Electric Fan --------- 2

    What I am trying to do is remove the items that I have sold out of my "Current Inventory" spreadsheet, into a "Sold Inventory" spreadsheet. For example, according to the "Sales" spreadsheet I sold 2 Apple Ipods. I want to remove the first two rows that contain the item name "Apple Ipod" along with the buy price for each of those items. I am basically just trying to use a First In First Out inventory method, but it is tough (for me) to track with the multiple "buy prices."

    Does anyone have ideas on how I can accomplish this?

    Thank you!

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Complex problem involving moving rows and returning different values from same criteri

    Hi try this,
    just run the code "Sold"
    this will check all items in Sales sheet, copy details from Currenty inventory to Sold inventory, then delete them from the Current inventory list and delete the sale items.
    Attached Files Attached Files
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Registered User
    Join Date
    06-15-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Complex problem involving moving rows and returning different values from same criteri

    Hi Sean,

    Thank you for your response! Could you tell me how I could replicate that code, or what you did? Also, when I run the code, I don't see the buy price of each item in the sold inventory spreadsheet. Is there a way to add that?

    Thanks so much!!

    Don

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Complex problem involving moving rows and returning different values from same criteri

    Hi,
    i have added the sale price now.
    You will need to copy the code from sheet2 into your workbook and change sheet names and ranges to suit.
    Not sure what your skill level is at, if you cant do this then it will be best if you can load your workbook for me to change.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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