+ Reply to Thread
Results 1 to 25 of 25

Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

  1. #1
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Question Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Current Spread sheet structure: Multiple Columns ("A" through "U") - 10,000+ rows
    Goal: Formula to calculate the Unallocated $ Value of Inventory (once per unique Item #)
    Dollar result to be shown in Column "U" - Row 2 (ability to copy down all rows)
    Primary Columns for reference:
    "A" - Item # (Number) - This can appear on multiple rows for multiple warehouse locations
    "F" - Location (Warehouse) - would only like to have Location "1" and Location "2" included
    "G" - Quantity on Hand
    "I" - Cost per Unit
    "K" - Quantity needed for Production
    "M" - Balance - currently a calculated column = ("G" minus "K")
    "N" - Revised $ Value - currently a calculated field = ("M" times "I")
    "U" - Unallocated $ Value (goal formula) - once per unique Item # in Column "A"
    My current formula in Column "U" (then copied down) is =IF(G2>K2,N2,0)
    This was sufficient when all "G" Quantity on Hand was in "F" Location 1 only
    Now a combination of "G" Quantity on Hand needs to be both "F" Location 1 and Location 2
    Any assistance would be greatly appreciated - Thank you.

  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,351

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    This ??

    =IF(SUMIF($A$2:$A$24,$A$2,$K$2:$K$24)>SUMIF($A$2:$A$24,A2,$G$2:$G$24),0,"")

  3. #3
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    John: Cheers! Thank you for the quick response - I will test and return a reply soonest.

  4. #4
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    John: I tried to follow up earlier - my message bounced back. Trying again now:

    Firstly, thank you for your efforts - the formula provided may need somehow to acknowledge the content of column A - by individual Item Number

    You'll note in the sample workbook - there are 8 rows for Item Number C051
    You'll note in the sample workbook - there are 8 rows for Item Number C1036
    You'll note in the sample workbook - there are 7 rows for Item Number C1077

    I'm looking for a way to make a calculation on each unique Item Number: (the number of rows per Item Number can vary)

    How it reads in my head: For Item Number C051, add the Qty on Hand in only Locations 1 and 2 ( total 277,382). If the resulting quantity is less than the Quantity Needed (total 1,999,102), return a $0.00 in Column U on the first row where Item C051 occurs.

    If the resulting number (Qty on Hand in Locations 1 and 2) is greater than the Quantity Needed: Calculate this dollar value to Column U on the first row where Item C051 occurs. Calculation would be (((Qty on Hand Location 1 + Location2)-Qty Needed)*Unit Cost)

    Repeat for next unique Item Number C1036 and return result to Column U on the first row where C1036 occurs.
    Repeat for next unique Item Number C1077 and return result to Column U on the first row where C1077 occurs.

    I hope this somehow helps to explain.

    Thank you again. Dave
    Last edited by Dave_in_RI; 09-02-2021 at 10:07 PM. Reason: Additional Clarification

  5. #5
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Maybe.
    U2
    =MAX(0,IF($G2>0,SUMIFS($G$1:$G2,$A$1:$A2,$A2)-SUMIFS($K$1:$K2,$A$1:$A2,$A2),0))

    note : the result is just quantity (not sure how to calculate cost due to different location might
    have different cost.)

    Regards.
    Last edited by menem; 09-02-2021 at 10:45 PM. Reason: add IF

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Try this in U2 and copy down:

    =IF(A2=A1,"",IF(SUM(SUMIFS($G$2:$G$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2))>SUM(SUMIFS($K$2:$K$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2)),SUM(SUMIFS($N$2:$N$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2)),0))

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Dave, do you realise that all the answers are zeroes because "Total Qty on Hand" are less than "Total Qty Needed" in your sample workbook?

    Another option: IF(COUNTIF($A$2:$A2,A2)=1,MAX(0,SUMPRODUCT(($G$2:$G$24-$K$2:$K$24)*($A$2:$A$24=A2)*$I$2:$I$24)),"")

  8. #8
    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,351

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    =if(k2=0,"",if(sumif($a$2:$a$24,$a$2,$k$2:$k$24)>sumif($a$2:$a$24,a2,$g$2:$g$24),0,""))

  9. #9
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Menem: Thank you for your efforts. I've tested and found the following:
    Your noted this result is just the quantity - you are correct. The next calculation would be to take that quantity and multiply by the Unit cost (which is currently consistent for all locations)
    I'd like that result (Qty * Unit Cost to appear only once per unique Item number. - Currently it appears in column U for each Location (thus increasing the desired result $)

    Appreciate the dialog - and your time. Dave

  10. #10
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Did you try my formula in post#6 above? Did it give the wrong answers?

  11. #11
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Greg: I've received your response - Thank you kindly: For Speed and memory / CPU usage, this works very nicely.

    As josephteh notes: My original sample attachment may not have given a complete understanding of the possible results.
    I am attaching a MODIFIED file to this reply (hope I'm doing it correctly).

    1. If the total QOH per Item is less than the total Quantity Needed per item, then return $0.00
    2. If the total QOH per Item is Greater than the total Quantity Needed per item, then return ((Total QOH - Total Quantity Needed)*Unit Cost)

    Hoping this helps - I'm excited to see such a response! Dave

  12. #12
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Greg: I've replied with a bit of additional information (and a slightly modified attachment to better illustrate the challenge)
    Thank you, Dave

  13. #13
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    josephteh: I'm realizing that now (My attachment may have been insufficient to fully illustrate the complete goal) - thank you for point that out. I've posted a slightly modified file to this reply.

    Summary Goal:
    1. If the total QOH per Item is less than the total Quantity Needed per item, then return $0.00
    2. If the total QOH per Item is Greater than the total Quantity Needed per item, then return ((Total QOH - Total Quantity Needed)*Unit Cost)

    Thank you so much for your effort. Dave

  14. #14
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    John:

    As josephteh notes: My original sample attachment may not have given a complete understanding of the possible results.
    I am attaching a MODIFIED file to this reply (hope I'm doing it correctly).

    1. If the total QOH per Item is less than the total Quantity Needed per item, then return $0.00
    2. If the total QOH per Item is Greater than the total Quantity Needed per item, then return ((Total QOH - Total Quantity Needed)*Unit Cost)

  15. #15
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Dave,
    My original formula in post #6 gives the same answers as your most recent file posted. Is there a sample where it gives the wrong answer?
    (you don't have to create a reply for each contributor, we'll read any post).

  16. #16
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    In case price (cost ?) are all the same for all location for each item.
    You may change formula from
    =MAX(0,IF($G2>0,SUMIFS($G$1:$G2,$A$1:$A2,$A2)-SUMIFS($K$1:$K2,$A$1:$A2,$A2),0))
    to
    =MAX(0,IF($G2>0,SUMIFS($G$1:$G2,$A$1:$A2,$A2)-SUMIFS($K$1:$K2,$A$1:$A2,$A2),0)*$I2)
    BUT above formula will give you a wrong result in case every location more than require quantity.
    ie. Location1 = 1000 , Location 2 = 2000 and just need only 500.

    Regards.

  17. #17
    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,351

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    As per #16

    =IF($K2=0,0,MAX(SUMIF($A$2:$A$24,$A2,$G$2:$G$24)-SUMIF($A$2:$A$24,$A2,$K$2:$K$24),0))*$I2

  18. #18
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Greg:

    Current try: =IF(A2=A1,"",IF(SUM(SUMIFS($G$2:$G$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2))>SUM(SUMIFS($K$2:$K$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2)),SUM(SUMIFS($N$2:$N$24,$F$2:$F$24,{1,2},$A$2:$A$24,A2)),0))

    My working spread sheet currently has nearly 70,000 rows (and could have more in the future).
    The above formula is returning $0.00 result for all Item Numbers through Row ~70,000.

    Perhaps the references to $24 in the above formula is limiting the overall analysis range?

    Thank you

  19. #19
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Yes, of course that's limiting it. It was just referencing your sample file. 2 things:
    1. You can try this and it won't matter how many rows you have:
    =IF(A2=A1,"",IF(SUM(SUMIFS($G:$G,$F:$F,{1,2},$A:$A,A2))>SUM(SUMIFS($K:$K,$F:$F,{1,2},$A:$A,A2)),SUM(SUMIFS($N:$N,$F:$F,{1,2},$A:$A,A2)),0))

    2. The other option would be to put your data into an Excel Table, and then reference the Excel Table Column

  20. #20
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Greg: This is working nicely - thank you all so very much for your assistance.

    Any thoughts on a "tweak" to conserve a bit of CPU consumption? (It only lasts for about 4-5 minutes).

    I believe we can close this issue as solved. Cheers!

  21. #21
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Any thoughts on a "tweak" to conserve a bit of CPU consumption? (It only lasts for about 4-5 minutes).
    Please see my option #2 in post #19.

    Sample attached.

  22. #22
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Greg: Understood - Thanks again for your assistance - Much appreciated.

  23. #23
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Good Morning: Option #1 in Post 19 was working flawlessly *until some additional warehouse locations were added to the requirement*

    1. You can try this and it won't matter how many rows you have:
    =IF(A2=A1,"",IF(SUM(SUMIFS($G:$G,$F:$F,{1,2},$A:$A,A2))>SUM(SUMIFS($K:$K,$F:$F,{1,2},$A:$A,A2)),SUM(SUMIFS($N:$N,$F:$F,{1,2},$A:$A,A2)),0))

    This formula was originally based upon the requirement to only include two locations: "1" and "2". The requirement now is to analyze four locations: "1", "1R", "2" and "2R"
    Any suggestions to modify? Thank you. Dave

  24. #24
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,848

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Off the top of my head I would replace the {1,2} with {"1","2","1R","2R"}. (include the quotes). If that doesn't work, please attach a file and show the results you're expecting.

  25. #25
    Registered User
    Join Date
    12-21-2018
    Location
    RI, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Formula to Calculate a $ Value per Unique Part# with Multiple Warehouse Locations

    Yes Greg! Thank you (I was missing the quotes). Much Appreciated. Dave

+ 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. Dynamic map for warehouse bin locations
    By narom5 in forum Excel General
    Replies: 2
    Last Post: 06-10-2020, 04:57 AM
  2. One vlookup formula for multiple different workbook locations
    By Weaselwithagun in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-12-2019, 11:59 AM
  3. Formula for Inventory using one quantity in multiple locations
    By shellymac in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-04-2018, 02:55 PM
  4. Replies: 8
    Last Post: 02-09-2015, 01:13 PM
  5. Warehouse Graphical Layout with Bin locations and Products
    By seekon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-10-2014, 03:25 AM
  6. Average formula for multiple locations
    By runner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-30-2014, 03:22 PM
  7. Lookup Quantity of Part by Warehouse
    By fasterthanyours in forum Excel General
    Replies: 16
    Last Post: 03-11-2011, 11:10 AM

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