+ Reply to Thread
Results 1 to 7 of 7

allocating a total amount based on conditions

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    allocating a total amount based on conditions

    Hi all,

    I have the following situation with which I need your help. I have a list with purchased quantities which is split per product (product ID) and purchase orders (one product can be purchased several times, each time it has assigned a new purchase order number; the purchase order number is higher for newer purchase orders). In another file I have a list of products (product ID) with their quantity on stock. I need to allocate the quantity on stock for each product ID to the respective purchase order. The logic would be that of FIFO, so then for the newest purchase number if the purchased quantity is lower then the stock quantity, the amount allocated would be the purchased qty, then it searches for the second newest purchase order and checks again if the purchase qty is lower or higher then the stock qty left; if the remaining stock qty is lower then it allocates all of it, if it's higher it allocates the purchase qty and goes to the next oldest purchase order, and so on. I have prepared a file with an example where I included also the result which should be achieved. The number of purchase orders is different depending on the product; it can be one or several depending how many times the product has been reordered. Also the original data files are very large, as they contain a lot of products.
    If additional clarifications are needed let me know.

    Thank you so much for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: allocating a total amount based on conditions

    D2=MEDIAN(C2,SUMIF($H$2:$H$4,$A2,$I$2:$I$4)-SUMIF($A2:$A$10,$A2,$C2:$C$10)+C2,0)
    Please Login or Register  to view this content.
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: allocating a total amount based on conditions

    Thank you. This works only if the products are sorted, but if they're in random order it doesn't work anymore.

  4. #4
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: allocating a total amount based on conditions

    What formulas can I use if the products are sorted in random order?

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: allocating a total amount based on conditions

    pls attach sample file after sorted in random order

  6. #6
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: allocating a total amount based on conditions

    Attached file with products in random order.

    Thank you!
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-18-2013
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: allocating a total amount based on conditions

    Any ideas on what formulas I need to use?

+ 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. Need help with allocating Revenue to months only for Year 2014
    By Saurabh.bhole in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-03-2014, 06:36 PM
  2. how to work out rate based on total time and total amount
    By lisaathers in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2013, 06:44 AM
  3. Replies: 3
    Last Post: 05-09-2012, 01:43 PM
  4. Calculate amount based on circumference / divide total in 2 locations
    By JACKIECOTHRON in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2012, 02:55 PM
  5. Need Macro to total based on certain conditions
    By crawfoam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2011, 04:39 PM
  6. FORMULA TO ADD AMOUNT BASED ON TWO or MORE CONDITIONS
    By excelkeechak in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-19-2009, 01:25 PM
  7. Replies: 2
    Last Post: 06-26-2006, 04:10 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