How to add up quantities that are associated ONLY with an "Identifier word" like a SKU or word across 2 or 3 sheets in the same workbook?

jbillh

New Member
Joined
Dec 9, 2015
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi Folks,

So, we're trying to figure out how to add up quantities in multiple cells that contain specific "Identifier words" ONLY in the same row as that specific "identifier word" across 2 or 3 sheets in the same workbook? The identifiers words like "SKU" or "butter" in the example, are not always in the same rows since we download data that changes row positions frequently. The quantities to add up will ALWAYS be in the same row as the identifier words but may not always be in the same column. That said, the column "name" will always be "units-1" or "units-2"

I hope the attached helps make more sense of this!

Thanks Kindly,

Bill
 

Attachments

  • mrExcelExample-.jpg
    mrExcelExample-.jpg
    179.4 KB · Views: 14
You bet! We used actual data in our process and had to work through some issues but here 'tis:

These three formulas are found on the results/ "Combined Inventory" sheet but refer to the two data sheets.

=UNIQUE(VSTACK(FILTER(VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1)),VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1))<>0),VSTACK(FILTER(VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1)),VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1))<>0))))


=IF(A2<>"",SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!E:E)+SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!G:G)+SUMIF('FBA-Inventory'!D:D,$A2,'FBA-Inventory'!M:M),"")


=IF(A2<>"",IFNA(IF(MATCH(A2,'Combined inventory'!A:A,)>0,"YES",""),"NO"),"")


These are the only formulas I can find. The third one is "dynamic" to sorta run a verification on the second one given there are some variations in the SKU's.

Is there something else you'd like to see?

Thanks for your help and I hope this is of use to someone! Bill
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Is there something else you'd like to see?
Yes, since the formulas are not entirely clear to me.

With XL2BB, and any sensitive data disguised, could you post a smallish section of
  • 'AWD-Inventory' that shows say 10 rows and columns B:G
  • 'FBA-Inventory' that shows say 10 rows and columns D and M (the columns between can be hidden before creating the XL2BB Mini Sheet to keep it small)
  • 'Combined Inventory' that shows a few rows with your above formulas in place. I am assuming your first formula above is in column A, but if not please include column A as well.

Just a thought in the interim though, does this formula produce the same results as the long first one above? I have assumed that the headings in D1 of FBA and C1 of AWD are the same. If they are different then change the very last 1 in my formula below to 2

Excel Formula:
=DROP(UNIQUE(TOCOL(HSTACK('FBA-Inventory'!D:D,'AWD-Inventory'!C:C),1)),1)
 
Upvote 0
Ok, folks... here you go. This is the answer an Excel Pro came up with for us. I hope this is useful somehow.

"FBA Inventory"
MR-EXCEL-inventory-report-dynamic-formula-Sample.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1CountryProduct NameFNSKUMerchant SKUASINConditionSupplierSupplier part no.Currency codePriceSales last 30 daysUnits Sold Last 30 DaysTotal UnitsInboundAvailableFC transferFC ProcessingCustomer OrderUnfulfillableWorkingShippedReceivingFulfilled byTotal Days of Supply (including units from open shipments)Days of Supply at Amazon Fulfillment NetworkAlertRecommended replenishment qtyRecommended ship dateRecommended actionUnit storage size
2USWidget A4ABC-350B02496NewSupplier 1USD199025000000000Amazonout_of_stock0noneNo action required
3USWidget B2CBA-150B03248NewunassignedUSD3870123600000000Amazonout_of_stock0noneNo action required0.0555 ft3
4USWidget C3XYZ-100B08792NewunassignedUSD21.824064000000000Amazonout_of_stock0noneNo action required0.567 ft3
5USWidget D1JKL-250B03321NewSupplier 1USD104.51903000000000Amazon00out_of_stock0noneNo action required0.0559 ft3
FBA-Inventory




"AWD Inventory"

MR-EXCEL-inventory-report-dynamic-formula-Sample.xlsx
ABCDEFGHIJK
1Product NameSKUFNSKUASINAvailable in AWD (units)Available in AWD (cases)Inbound to AWD (units)Inbound to AWD (cases)Outbound to FBA (units)Available in FBA (units)Available in FBA (days)
2Widget DABC-2501B033210000300022
3Widget BCBA-1502B032481002460505223
4Widget CXYZ-1003B08792400400026260
5Widget AJKL-3504B024961002240504652
AWD-Inventory




"Combined Inventory"
MR-EXCEL-inventory-report-dynamic-formula-Sample.xlsx
AB
1SKUCombined Quantity
2ABC-35025
3CBA-150158
4XYZ-100464
5JKL-2503
Combined inventory
Cell Formulas
RangeFormula
B2:B5B2=SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!E:E)+SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!G:G)+SUMIF('FBA-Inventory'!D:D,$A2,'FBA-Inventory'!M:M)




"Combined Dynamic"
MR-EXCEL-inventory-report-dynamic-formula-Sample.xlsx
ABCDE
1SKUCombined QuantityDoes it Exists on Combined
2ABC-35025YES
3CBA-150158YES
4XYZ-100464YES
5JKL-2503YES
61
72
83
94
Combined Dynamic
Cell Formulas
RangeFormula
A2:A9A2=UNIQUE(VSTACK(FILTER(VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1)),VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1))<>0),VSTACK(FILTER(VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1)),VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1))<>0))))
B2:B5B2=IF(A2<>"",SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!E:E)+SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!G:G)+SUMIF('FBA-Inventory'!D:D,$A2,'FBA-Inventory'!M:M),"")
E2:E5E2=IF(A2<>"",IFNA(IF(MATCH(A2,'Combined inventory'!A:A,)>0,"YES",""),"NO"),"")
Dynamic array formulas.
 
Upvote 0
Thanks for the samples. First some comments.
  • I would generally try to avoid whole column References in formulas. In some cases that can make formulas very slow to calculate, having to deal with over a million rows. In my suggestions below I have used down to row 1000 but if you need bigger just change that number. Even if you had to make it 100,000 that is still less than 1/10 the number of cells in a whole column.

  • I would also try to avoid volatile functions like OFFSET as that can also badly affect the performance of your worksheet.

  • With your Excel version it is often possible to avoid copying formulas down the column like you have in column B of 'Combined Dynamic'. (I'm not sure why those formulas stopped at row 5 either but perhaps that was just an oversight.
Anyway, if what you have shown in 'Combined Dynamic' is what you want then certainly the column A values can be obtained with a much sorter, more efficient and non-volatile formula as shown in G2.
My formula in H2 is a bit longer than the one you have in col B, but it does not need to be copied down.

.. and if you did want all those results with a single formula (ie both columns at once) I have provided an option in cell J2

jbillh.xlsm
ABCDFGHIJK
1SKUCombined QuantitySKUCombined QuantitySKUCombined Quantity
2ABC-35025ABC-35025ABC-35025
3CBA-150158CBA-150158CBA-150158
4XYZ-100464XYZ-100464XYZ-100464
5JKL-2503JKL-2503JKL-2503
611010
722020
833030
944040
10
Combined Dynamic
Cell Formulas
RangeFormula
A2:A9A2=UNIQUE(VSTACK(FILTER(VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1)),VSTACK(OFFSET('FBA-Inventory'!D:D,1,0,COUNTA('FBA-Inventory'!D:D)-1))<>0),VSTACK(FILTER(VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1)),VSTACK(OFFSET('AWD-Inventory'!C:C,1,0,COUNTA('AWD-Inventory'!C:C)-1))<>0))))
G2:G9G2=LET(sku,UNIQUE(TOCOL(HSTACK('FBA-Inventory'!D2:D1000,'AWD-Inventory'!C2:C1000),1,1)),sku)
H2:H9H2=LET(awdb,'AWD-Inventory'!B2:B1000,BYROW(G2#,LAMBDA(r,SUMIF(awdb,r,'AWD-Inventory'!E2:E1000)+SUMIF(awdb,r,'AWD-Inventory'!G2:G1000)+SUMIF('FBA-Inventory'!D2:D1000,r,'FBA-Inventory'!M2:M1000))))
J2:K9J2=LET(bc,'AWD-Inventory'!B2:C1000,b,TAKE(bc,,1),sku,UNIQUE(TOCOL(HSTACK('FBA-Inventory'!D2:D1000,TAKE(bc,,-1)),1,1)),HSTACK(sku,BYROW(sku,LAMBDA(r,SUMIF(b,r,'AWD-Inventory'!E2:E1000)+SUMIF(b,r,'AWD-Inventory'!G2:G1000)+SUMIF('FBA-Inventory'!D2:D1000,r,'FBA-Inventory'!M2:M1000)))))
B2:B5B2=IF(A2<>"",SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!E:E)+SUMIF('AWD-Inventory'!B:B,$A2,'AWD-Inventory'!G:G)+SUMIF('FBA-Inventory'!D:D,$A2,'FBA-Inventory'!M:M),"")
Dynamic array formulas.
 
Upvote 0
Thanks Peter! What you say makes good sense to me... with my limited understanding of formulas and functions. :-) I'll make sure my right-hand man sees this and has a chance to evaluate if we should make some mods accordingly. While we haven't used it enough yet to see it perform slowly or such, we don't expect our downloads to exceed 500 lines of data, at the most, ever. We should probably dial-in those parameters. On the Dynamic sheet... I included the 1, 2, 3, 4 but that's only because I could change them from their original values but couldn't delete them without changing the code beyond my understanding. So far... we are thrilled with the way this works as it takes what is often a 2 - 3 hour manual process and allows us to figure things out in under a few minutes, from download to final pasting into another sheet for "mostly accurate and mostly current" inventory numbers. We are feeling very grateful for Excel and folks that know how to run it way better than us! :-) Thanks Kindly and Take Good Care!
 
Upvote 0
You're welcome. Hope it all works out for you. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,114
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top