How to calculate with reference id - excel

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.

Related

Copy entire rows that has unique value on Excel

I have a table with several rows which may contain an equal value (specifically the product code) I have to create another table with a summary of the quantities of the products, so for example, if I have 3 identical products in table 1, in the summary table I only need to have one time that product code with a column that will show me quantity = 3 and the other columns must be filled in with the other product information, on google sheet I managed to do it with this formula: =unique(query(scan!b5:j,"select b,c,d,e,f,g,h",1))
EXAMPLE
how do I do this with excel functions?

Excel: Extracting data based on range

I have a table for the number of products sold:
I have another table that calculates the cumulative product sold
I have a price table based on # of product sold:
What equation should I write to get the cost price of the product based on cumulative data? Basically, as the cumulative product for category A is less than 10 till 2022 the multiplier price is $5 but in 2023 as the cumulative product is more than 10 the multiplier is $3.
Please know that the actual data set has a price multiplier for multiple range and the number of products sold is in million. The above is just a sample.
Lose the < character in the Item column of the price table. Then you can use it for an approximate lookup.
Let's say the price table is on a sheet called PriceSheet and starts in cell A1, so the first row of data is in row 2. The price table must be sorted ascending by the first column. To look up the price use
=vlookup(A1,PriceSheet!$A$2:$B$5,2,1)
Multiply that with the count.
=A1*vlookup(A1,PriceSheet!$A$2:$B$5,2,1)
Now just change A1 to the cell that has the cumulative count.

How to change value of field based on values of two other fields in Excel or Google Sheets

I'm trying to create a customized personal expense report on Google sheets . If anyone has suggestions for a better approach, I'm open to to ideas!
In one column Category, I have option to select category with a drop down - Restaurants, Rent, Electricity etc. The column Value on the next to it holds the an integer value.
On a the same sheet, I have a column where all categories are defined. In the column Limit next to it, is the maximum integer value for each category. The next column Balance holds the remaining value (Limit - Sum of all Value matching Category)
My question is - when I add an entry in sheet 1 for any category with a value, how do I subtract the Value added from the respective Category to show the remaining balance from Limit in Balance column? As I keep adding items, the Balance field should get updated.
TABLE 1
Item Category Value
i1 Rest 100
i2 Rent 50
..
..
TABLE 2 (In same sheet somewhere adjacent to the above table)
Category Limit Balance
Rest 500 400
Rent 1000 950
..
..
Try using this:
=IFNA([limitcellname]-SUMIF([rangeofcategories],[categorycellname],[expensevaluerange]),[limitcellname])
Range of categories = column where all categories are listed in the expenses table. E.g- B:B if B column has expense categories
expense value range = column where all expenses are listed in the expenses table. E.g- C:C if expenses values are in C column
category cell name is the category cell in the balance table
limit cell name is the limit cell
This should work for your purposes

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.

Excel Sum Based on Selection of Item List

**My excel sheet lists County's and its tax rate.
At the end of the month, I have to document the sales tax of each sale.
I have 3 columns that looks something like this:
Column A is Select a County (This is created in the form of a drop-down list)
Column B is the selection from column A's rate
Column C is Sale Contract Number
Column D is the amount of sales tax column C was
How can I create a sum for a given county (Column A) using the monetary values in Column D?
I already tried //=SUMIFS(A:A, D:D, "=Albany")//
but that didn't do the trick
I want to calculate the total sales tax for every county once I completed the list. County's are selected via a drop-down list, and sales tax (column D) are manually entered.
Any suggestions?**

Resources