SUM If row value is the same?

AndyGray

New Member
Joined
May 31, 2017
Messages
30
This might get a little bit misleading however I will try and be as clear as possible....
This below table represents Sheet 1.
Line NumberStock
400110
400250
4003250

<tbody>
</tbody>

Sheet 2 is linked to sheet 1 via Line number and the total stock needs to match up to stock on this table, but by a sum of each line.

Line NumberBatchStock
400175-B10
400277-B50
400369-D50
4003
69-D
100
4003
72-B100

<tbody>
</tbody>

In Sheet 2. I want to have an additional row called Total Stock which will automatically calculate the stock value of the line number. So Line number 4003 will bring back a value of 50+100+100.


this will then be used to do a true or false check on sheet 1 (does stock match?)

Any suggestions are welcome.

Thanks.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
In Sheet 2. I want to have an additional row called Total Stock which will automatically calculate the stock value of the line number. So Line number 4003 will bring back a value of 50+100+100.

Hi, I don't know if you got your sheets mixed up, but wouldn't it be better to return the calculated stock to sheet 1 to do the check? i.e.


Excel 2013/2016
ABCD
1Line NumberStockTotal StockCheck
240011010TRUE
340025050TRUE
44003250250TRUE
54004100105FALSE
Sheet1
Cell Formulas
RangeFormula
C2=SUMIFS(Sheet2!C:C,Sheet2!A:A,A2)
D2=B2=C2




Excel 2013/2016
ABC
1Line NumberBatchStock
2400175-B10
3400277-B50
4400369-D50
5400369-D100
6400372-B100
74004a5
84004b100
Sheet2
 
Upvote 0
Sheet 1 is data that can be easily exported from the current database i'm using. So i have counts currently in here of a specific value as it is a raw data export. This basically displays "Product/Warehouse/Stock" But each Stock line and warehouse line have a unique line (hence line number) Product A will be in warehouse 1 2 and 3. but will have a unique line for each one...

The new system we are moving over to requires batches to be put in (these are going to have to be manually inserted) When this count is getting inserted into sheet 2. I wanted the check to show up on this sheet so I can match up as the data is input. I've just looked into the SUMIF formula (thank you for that by the way)

=SUMIF($C$3:$C$444,C3,$N$3:$N$444)

So it is checking row C for values which are the same, then using the criteria for them values to bring back a total sum of them specific lines. Then my Vlookup is on the next row over...


Now i am able to do a check and say Does it match? Or i can even say "discrepancy difference" and tell me how much my count is out by so i can adjust accordingly.

Thanks for your help.
 
Upvote 0
Now i am able to do a check and say Does it match? Or i can even say "discrepancy difference" and tell me how much my count is out by so i can adjust accordingly.

I'm going to say "Yes" :confused:
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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