Pulling Data from Two Other Sheets to Calculate Cost of Goods Sold

madmoneymike5

New Member
Joined
Nov 25, 2018
Messages
6
My question is rather complicated to explain via typing it out. If I could do a bit of show-and-tell then the answer I receive will likely I be more accurate and result in less back-and-forth trying to clarify things. So it is in that spirit that I took the time to create a short video that does just that, and I ask that you watch it to get a better understanding of what it is I'm trying to accomplish.

https://www.youtube.com/watch?v=G995_5QzNcE

The short text version: I need to search through a sheet with sales data on it and cross reference that to a sheet with costs of goods, then tabulate those together to determine how much (in terms of cost) inventory was sold in the sheet with sales data. There are some nuances though because the sales data doesn't have just one line per order; it sometimes has multiple lines per order that are not inventory related. See the video for a better explanation.

Thanks!

Mike


P.S. I promise it's nothing obscene, spam, or anything of the like. It truly is a "video question."

 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
is that what you want?

MSKUCountAmountCosts.Active Cost/Unit
193-B01NBRE3Z4-20180919-4.69
6​
10.3​
0.56​
88-B003FOAIQ4-20180915-6.06
21​
63.86​
6.06​
1022725809
3​
15.66​
10.39​
167-B07D3SFY2F-20180918-12.73
17​
64.98​
12.73​
165-B075ZHNM7N-20180918-4.73
3​
7​
4.73​
64-B003753C4G-20180919-2.93
3​
10.75​
4.69​
5-B07F6WK3B5-5.80
3​
10.4​
5.8​
78-B01M4JVBYO-20180914-4.39
3​
6.02​
4.39​
3-B07D4MW5WX-6.60
12​
47.04​
6.6​
4-B07GBSZD2Q-5.80
3​
10.23​
5.8​
184-B0019I83N8-20181004-5.07
3​
6.21​
5.07​
1022759056
6​
23.8​
4.23​
236-B003IWR0FA-20181013-4.93
3​
6.97​
4.93​
256-B00HVLXNQO-20181019-25.97
5​
46.26​
25.97​
185-B00SOXI584-20181004-3.26
3​
5.02​
3.5​
141-B01IUDOHIO-20180924-18.49
3​
13.18​
18.49​
152-B0775Z27Q4-20180926-2.97
3​
3.79​
2.74​
56-B01JKO13HU-20180822-13.59
3​
11.25​
13.59​
233-B00IY5CFWE-20181013-3.99
6​
8.98​
3.99​
230-B019G0C66K-20181016-7.99
10​
20.96​
5.99​
234-B01NC3DFLC-20181013-4.99
3​
4.89​
4.99​
1022729441
3​
24.43​
21.11​
274-B01N8YPL5Z-20181013-23.52
3​
30.56​
23.52​
23-B0079OYJXY-1.60
3​
4​
1.6​
151-B01H9QLMZY-20180919-2.26
1​
8.22​
2.26​
250-B01519TWOE-20181019-5.00
3​
3.56​
5​
213-B00IZI8OC0-20181016-4.32
8​
9.72​
4.32​
1022814868
3​
16.57​
7.49​
199-B01KPSJ85Y-20181014-2.82
16​
47.71​
2.83​

or I misunderstood :(
 
Upvote 0
or like this one:

MSKUQPCosts.Active Cost/UnitMultiplication
193-B01NBRE3Z4-20180919-4.69
6​
0.56​
3.36​
88-B003FOAIQ4-20180915-6.06
21​
6.06​
127.26​
1022725809
3​
10.39​
31.17​
167-B07D3SFY2F-20180918-12.73
20​
12.73​
254.6​
165-B075ZHNM7N-20180918-4.73
3​
4.73​
14.19​
64-B003753C4G-20180919-2.93
3​
4.69​
14.07​
5-B07F6WK3B5-5.80
3​
5.8​
17.4​
78-B01M4JVBYO-20180914-4.39
3​
4.39​
13.17​
3-B07D4MW5WX-6.60
18​
6.6​
118.8​
4-B07GBSZD2Q-5.80
3​
5.8​
17.4​
184-B0019I83N8-20181004-5.07
3​
5.07​
15.21​
1022759056
6​
4.23​
25.38​
236-B003IWR0FA-20181013-4.93
3​
4.93​
14.79​
256-B00HVLXNQO-20181019-25.97
5​
25.97​
129.85​
185-B00SOXI584-20181004-3.26
3​
3.5​
10.5​
141-B01IUDOHIO-20180924-18.49
3​
18.49​
55.47​
152-B0775Z27Q4-20180926-2.97
3​
2.74​
8.22​
56-B01JKO13HU-20180822-13.59
3​
13.59​
40.77​
233-B00IY5CFWE-20181013-3.99
6​
3.99​
23.94​
230-B019G0C66K-20181016-7.99
10​
5.99​
59.9​
234-B01NC3DFLC-20181013-4.99
3​
4.99​
14.97​
1022729441
3​
21.11​
63.33​
274-B01N8YPL5Z-20181013-23.52
3​
23.52​
70.56​
23-B0079OYJXY-1.60
3​
1.6​
4.8​
151-B01H9QLMZY-20180919-2.26
1​
2.26​
2.26​
250-B01519TWOE-20181019-5.00
3​
5​
15​
213-B00IZI8OC0-20181016-4.32
8​
4.32​
34.56​
1022814868
3​
7.49​
22.47​
199-B01KPSJ85Y-20181014-2.82
19​
2.83​
53.77​
 
Upvote 0
Hi Sandy!

Thanks for the response.

This is definitely a major step in the right direction! A few notes:


  • I think the second table you posted with the column headers MSKU, QP, Costs.Active Cost/Unit, and Multiplication is the correct concept. I'm confused by the first table.
  • In column A, I need a distinct list of MSKUs that sold. I pretty sure that you accomplished this already because I don't see any duplicate values in your tables and I don't see any MSKUs that didn't actually sell. Awesome!
  • In column B, I need a summation of the number of sales for each unique MSKU. I think your version currently counts the number of times each MSKU appears, which, on the surface, would seem to be the right approach, but actually, we need to ignore certain appearances. For example, in your tables, you have MSKU 236-B003IWR0FA-20181013-4.93 counted 3 times when it actually only sold once. It shows up 3 times in the Amazon Flat File V2 because those three rows are all part of a single order. In the first row, the customer paid $13.74 ("Principal"), but in the second and third rows, Amazon took out commissions on that sale of $4.71 and $2.06. Thus, there was only 1 sale of this item and column B for this MSKU should show 1, not 3. In Psuedo code: Sum "quantity purchased" (Column W) only when "Principal" in column N is present.

Thank you again for your help! I appreciate it!

-Mike
 
Upvote 0
sure

MSKUQtyCosts.Active Cost/UnitMultiplication
88-B003FOAIQ4-20180915-6.06
9​
6.06​
54.54​
193-B01NBRE3Z4-20180919-4.69
1​
0.56​
0.56​
1022725809
1​
10.39​
10.39​
167-B07D3SFY2F-20180918-12.73
6​
12.73​
76.38​
165-B075ZHNM7N-20180918-4.73
1​
4.73​
4.73​
64-B003753C4G-20180919-2.93
1​
4.69​
4.69​
5-B07F6WK3B5-5.80
1​
5.8​
5.8​
78-B01M4JVBYO-20180914-4.39
1​
4.39​
4.39​
3-B07D4MW5WX-6.60
6​
6.6​
39.6​
4-B07GBSZD2Q-5.80
1​
5.8​
5.8​
184-B0019I83N8-20181004-5.07
1​
5.07​
5.07​
1022759056
2​
4.23​
8.46​
236-B003IWR0FA-20181013-4.93
1​
4.93​
4.93​
256-B00HVLXNQO-20181019-25.97
1​
25.97​
25.97​
185-B00SOXI584-20181004-3.26
1​
3.5​
3.5​
141-B01IUDOHIO-20180924-18.49
1​
18.49​
18.49​
152-B0775Z27Q4-20180926-2.97
1​
2.74​
2.74​
56-B01JKO13HU-20180822-13.59
1​
13.59​
13.59​
233-B00IY5CFWE-20181013-3.99
2​
3.99​
7.98​
230-B019G0C66K-20181016-7.99
2​
5.99​
11.98​
234-B01NC3DFLC-20181013-4.99
1​
4.99​
4.99​
1022729441
1​
21.11​
21.11​
274-B01N8YPL5Z-20181013-23.52
1​
23.52​
23.52​
23-B0079OYJXY-1.60
1​
1.6​
1.6​
250-B01519TWOE-20181019-5.00
1​
5​
5​
213-B00IZI8OC0-20181016-4.32
2​
4.32​
8.64​
1022814868
1​
7.49​
7.49​
199-B01KPSJ85Y-20181014-2.82
5​
2.83​
14.15​

is this is ok?
Names of headers are cosmetic, you can rename it as you wish

btw. ignore post#4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,495
Messages
6,130,979
Members
449,611
Latest member
Bushra

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