Subtract and Add Inventory (SUMIF) - excel

I have an Inventory System that will be used by Users to both check-in and check out items. The SKU of each item will be matched through the File
to either add or subtract from the Starting Quantity that is in Sheet 1.
Sheet 1 houses an SKU of each item in Inventory (column B), the Original Quantity (Column I) and Current Quantity (Column F) for each item.
Sheet 2 is the Checkout Sheet (SKU is Column C and Quantity Taken is Column F)
Sheet 3 is the Check-in Sheet (SKU is Column C and Quantity Added is Column F)
In Sheet 1, I need the Current Quantity Column to update as Items are either Checked In or Out from Sheets 2 and 3.
My formula for Sheet 1, Current Quantity Column:
=IF(B448="","",I448-SUMIF(CheckOUT!$C$2:$C$50000,B448,CheckOUT!$F$2:$F$50000)),(I448+SUMIF(CheckIN!$C$2:$C$50000,B448,CheckIN!$F$2:$F$50000))
Which receives an error of "#Value".
The beginning part of the formula,
=IF(B448="","",I448-SUMIF(AWCheckOUT!$C$2:$C$50000,B448,AWCheckOUT!$F$2:$F$50000))
successfully works by itself to deduct items as they are checked out from Sheet2.
Similarly, the ladder part of the formula,
(I448+SUMIF(CheckIN!$C$2:$C$50000,B448,CheckIN!$F$2:$F$50000))
successfully works by itself to add items as they are checked in from Sheet3.
However, when I combine the two formulas, a #Value error is returned.
I would greatly appreciate if someone could help me with this, please.
Thank you so much!

Related

I need to retrieve the date from the row that will deplete my inventory

This is hard to explain...
I have a report that I pull from our MRP system that gives me a Due-Date, a quantity required, and an item number. There will usually be several rows with the same item number each representing a different sales order.
I have another report that gives me the on hand quantity for each item. In this report, each item is listed only once.
I need to get the Due-Date that corresponds to the row that will use up the last of my inventory. (Inv. runout)
Due-Date
QTY-REQ
ITEM
4/27/21
5
C
4/28/21
7
A
4/29/21
5
B
4/30/21
1
B
5/1/21
13
A
5/2/21
4
A
5/3/21
12
C
5/4/21
1
A
OHQ
ITEM
INV. RUNOUT
10
A
formula here, Result should be 5/1/21
5
B
result should be 4/30/21
10
C
result should be 5/3/21
I hope this makes sense, if not, please let me know what I can answer to help with this.
-Nick
You'll need a new column on the first report using IF(SUMIFS( to only show the date of lines where the stock runs out at or before that date. Then in the second report, use MINIFS(), a fairly new function, to find the earliest date in that column that matches each product.
In the below example I'm assuming that both of the above reports shown are columns A B and C, in the same excel file, on sheets called Report1 and Report2.
In cell Z2 on Report1, enter the formula IF(SUMIFS(B:B, A:A, "<=" & A2, C:C, C2) > INDEX(Report2!A:A,MATCH(Report1!C2,Report2!B:B,0)), A2, "") and copy down for all rows. This will only display the date where the stock has run out by that date.
In cell C2 on Report2, enter the formula =MINIFS(Report1!Z:Z, Report1!C:C, Report2!B2) to get the earliest relevant date displayed from the formula above.

Excel: Index match if date matches month?

I have two excel sheets:
Data:
Column A Column E
01/01/2017 Supplier 1
05/01/2017 Supplier 2
05/01/2017 Supplier 1
Sheet 2:
I am trying to look up the supplier where the month of the date in column A matches the month number in cell F11.
F11 = 1
=IF(ISERROR(INDEX(Data!$A:$I,SMALL(IF(MONTH(Data!A:A)=$F$11,ROW(Data!$A:$A)),ROW(1:1)),5)),"",INDEX(Data!$A:$I,SMALL(IF(MONTH(Data!A:A)=$F$11,ROW(Data!$A:$A)),ROW(1:1)),5))
For some reason this doesn't work and i get no result.
I also need to only list each supplier name the once, unique values. But i believe my formula gives me the same result twice.
Please can someone show me where i am going wrong?
Can't you do this with a pivot table?
Just drag the date field into the columns box, then right-click, choose 'Group' and choose 'months'. Then drag the supplier field underneath it and you should get a list of all unique suppliers by month.
Edit:
Example below.

Match descriptions and copy/paste associated quantity

In Sheet 1, column A contains a list of product names and column B a list of quantities. The number of rows is variable and could be a minimum of 1 and a maximum of 15 (from row 62 to 76 - blank rows are automatically hidden). In Sheet 2, column A contains the same product list, but all 15 of them, ie Sheet 1 is a dynamic range and Sheet 2 is a static range. I am attempting to set up a VBA procedure whereby the macro will match the product in column A62 (Sheet 1) with column A4-18 (Sheet 2), copy the corresponding quantity from column B in Sheet 1 to column B in Sheet 2 and then move down the product list in Sheet 1, doing the same till it reaches the end of the dynamic range.
If anyone can assist or point me in the right direction, I'd be very grateful. Many thanks.

Excel multiple criteria to retain rows that prioritise during deduplication - VBA macro or other method

I need a solution to this so would any kind people out there that can help a novice Excel user?
I have three columns. Column A contains 10000 email addresses, Column B contains three values (Dr, Prof, Student), Column C contains title of project.
The problem: Same people (judging by email address) appear in this spreadsheet more than once with different value in column B (same person appears as Prof, Dr and Student).
Solution required: create three columns that count how many times same email address (Column A) appears on column A for each of the column b values. So I will then have a count of how many times an email address appears on the spreadsheet per (column b value).
Then deduplicate spreadsheet by Column A and B in a way that prioritises as follows : 1) prof over Dr and Student and 2) dr over student. In this way the rows to be retained will prioritise Professors and doctors over students.
I think it should work if you do the following (please create a backup first):
Search and replace 'Professor'-> '_Professor'
Sort the data by Email and Title (Prof,dr,student). You should now see the groups of duplicate email addresses, where the record to keep is the top one
In a new column (touching the data range) enter True at row 1 (assuming and you don't have headers)
Add a formula to the new column at row 2. (assuming the emails are in column A).
=A1<>A2
Extend the formula down
Copy/ paste the new column to values
Sort the data by the new column
All the rows that have False in the new column can be deleted.

How to calculate with reference id

I have a workbook in which there is stock detail on sheet 1 and sales detail on sheet 2.
I want to auto-calculate the remaining stock. But the sales inventory is based on dates so all the different products are mixed up. Every product has a unique ID. So how I can subtract the sale product from stock based on their IDs?
An example:
The customer comes and buy 4 shirts.
I enter the product with product ID, and in the Qty column I added 4.
Now I want to minus 4 from actual stock.
How it can be done in Excel?
You need to take the sum of all sold products in sheet 2 based on condition that productID in sheet2 equals our interesting product in sheet1. Use:
=SUMIFS(B2:B100,A2:A100,productID)
where column A contains product IDs and column B contains "sold" values.
Then subtract that sum from the stock total in sheet1, e.g:
=B3-(SUMIFS(Sheet2!B1:B100;Sheet2!A1:A100;A3))
where column A contains product IDs and column B includes stock totals.
(note how "productID" from the first expression is here replaced with "A3", i.e. the value of productID column for the current row).
Copying this last formula to other product rows should automatically update the relevant values.

Resources