INDEX MATCH multiple criteria to include date - excel

I have a table with few types of items buying in and selling out. I created a formula which calculates the total selling price when item was sold.
How do I include a date criteria in the formula so that it can capture an existing item with a new price? Thank you.
ADDED QUESTION TO THE ANSWER:

The following formula will do it.
This is a normal formula. Do NOT array-enter:
=IF(D10,LOOKUP(2,1/((B$2:B10=B10)*(C$2:C10>0)),C$2:C10)*D10,"")
Note: this does not use the date, but instead uses the latest pricing data.

Related

How to sum value of the same products according to the year they were sold?

I have an excel sheet with the list of all the products sold in different years. I need to display separately the total price of the each product that was sold in 2016 only:
and I need to get all the prices of the products sold in 2016 ( for each product separately) and create a new table like this
So if there are 100 laptops sold over the years, I need to create a new table with total price of the sold laptops in 2016.
I tried to achieve this by using sumif, but I can't figure out how to write correct condition. Any help would be greatly appreciated.
Add anothercolumn to identify the year sold, e.g =year(a2). Create a pivot and filter on the new column.
Here is the SUMIFS formula that escaped you.
=SUMIFS($C$2:$C$8,$A$2:$A$8,">"&DATE(G$1,1,0),$A$2:$A$8,"<"&DATE(G$1,12,32),$B$2:$B$8,F3)
In the picture below it is in cell F3 from where it can be copied down.
By simply changing the year in G1 you can get the results for different years. So, you could create a list of all items with a column for each year and see the results side by side.
The formula for finding the SUM for all products depending on the DATE:
=ARRAYFORMULA(SUMIF(YEAR(A:A); 2016*{or your reference cell}*; C:C))
The formula for finding the SUM from both DATE and CATEGORY:
=ARRAYFORMULA(SUMIFS(C:C; YEAR(A:A); 2016 *{or your reference cell}*; B:B; "laptop" *{or your reference cell}*))
It won't work without ARRAYFORMULA and be careful with quotes,

Excel formula to look up a value using Row and Column values in a table

This is a two part question. I want to lookup a price of an item based upon the effective date of the price. I've seen the vertical effective date examples but mine is somewhat different. I have the Items in the first column (A). The remaining columns contain a header with the effective date of the price. Hopefully I'm able to attach the format example. The reason I have the table formatted this way is that I don't want to duplicate the items when a new price is entered. So, I want to provide the formula an ITEM and then select the current price base upon the effective date. Right now the table has 2 effective date columns. So,The second question is how can I format the table so when I add a NEW price with a new effective date (an additional column) without having to change the look-up formula? Can the formula be formatted to be dynamic?
Thanks in advance for your input.
As per my comment:
The formula in B11:
=INDEX(1:8,MATCH(A11,A:A,0),MATCH(TRUE,INDEX(ISBLANK(1:1),),0)-1)
As you notice I have populated A1 to get this working correctly.
You can use:
=INDEX(1:1040000,MATCH("ITEM1",A:A,0),MATCH(1E+99,1:1))
If the date is always equal to or less than today I would use:
=INDEX(1:1040000,MATCH("ITEM1",A:A,0),MATCH(TODAY(),1:1))
Where the item can be replaced with a cell reference that contains the item to be looked up.
Please refers to JvdV's table, another shorter formula option
In B11, enter formula :
=LOOKUP(9.9E+307,INDEX(1:8,MATCH(A11,A:A,0),0))
Thank you everyone for your input. It was invaluable for working a solution to my problem.

How do I make a lookup formula also include a date range condition?

I'm trying to return a text value based on other text values matching AND a row's date falling in between another specified date range.
I'll try to create a simplified example of what I'm trying to achieve.
Let's say I have the following table breaking out produce units sold by day:
ProduceTable:
Now, let's say that I have another table detailing the discounts that I ran for items during certain date ranges:
ProducePromoTable:
[Edit: This example isn't great because the discount amounts are numerical, so ignore that and pretend that it's just text because that's what I'm really after. SUMIFS (I think) are off the table since I'm not trying to return a number value.]
What I would like to do is pull the discount amount into the first table based on whether the type of produce matches AND checking for whether there was a discounted price on that item on that particular day.
I've tried some lookup combinations and index-match, but I haven't quite cracked the code.
Anyone have any suggestions?
Assuming your other table is on a sheet named 'Discounts', then you can use this formula on cell D2 of the first table and copy down:
=IFERROR(INDEX(Discounts!$B$2:$B$6,MATCH(1,INDEX((Discounts!$A$2:$A$6=B2)*(Discounts!$C$2:$C$6<=A2)*(Discounts!$D$2:$D$6>=A2),),0)),"")
I would use the SUMPRODUCT function to find your values:
=IFERROR(INDEX($G$2:$G$5,SUMPRODUCT(($F$2:$F$5=B2)*($H$2:$H$5<=A2)*($I$2:$I$5>=A2)*ROW($G$2:$G$5))-1),"Not in Range")

Use date reference is a vlookup formula

I have attached a printscreen to make it easier to understand my question.
I'm creating a supply management woorkbook. Income will refer to the purchases and outcome the resale of this purchases. Because there will be price variations, I'm looking for a formula to insert on Outcome Total Price that will return the purchase price of the item sold to deduct from the total value of my stock.
I don't know if it's possible to use a second reference on vlookup formula, like to return the price of product A with the condition that it has to be before the date 19/09/2016.
Adriano
Assuming there will be no more than one entry for any given product on any given day, and assuming the data is ordered chronologically, try this in F3 and copy down
=IF(E3>0,SUMPRODUCT($D2:D$3,--($A2:A$3=A3),--($B2:B$3=MAX($B2:B$3))),"")

INDEX&MATCH excel on rows and return SUMPRODUCT

I needed some help with Excel functions as I am not really sure how to achieve this.
Basically, this picture shows my data structure:
I am aware that I can use Index& Match excel functions together for columns but I am not sure if it is possible use Index&Match together on two row conditions.
Requirement:
I have three products, product A, product B and Product C. I want to be able to quickly calculate the actual revenue and and you can see the data structure in the image above. My top-most row is month. For each month, I have 4 columns, of which 2 need to be calculated should the condition match.
This is the condition. An example, for product A, calculate the total sumproduct(multiples column actual customers x Price Actuals) for yearMonth 201501.
So basically,first, for product A, it would need to find YearMonth 201501, and when it is found, it should find columns Actual Customers and Price Actuals and return the SUMPRODUCT of Actual Customers and Price Actuals.
Is it possible to do this?
I have searched the Internet a bit and I have not found a solution.
Update:I thought I could post the follow-up question in the same thread insted of Cristiano duplicates... For the accepted answer, in the excel formula, how can it be divided by the total amount of "actual customers" for that month?
Simply adding "actual customers" with a slash before IT does not work.
You need a cell where you specify the month you want to look up. Give that cell the name "TheMonth".
You need a cell where you specify the product you want to look up. Give that cell the name "TheProduct".
Then, assuming your screenshot starts in cell A1, you can use
=SUMPRODUCT($B$3:$I$5*($B$1:$I$1=TheMonth)*(($B$2:$I$2="Actual Customers")+($B$2:$I$2="Price - Actuals"))*($A$3:$A$5=TheProduct))
Next time, please post a link to a workbook. It's not much fun typing in the text and numbers from a screenshot in order to verify a formula.
Here is the workbook with the formula in action.

Resources