SUM values with VLOOK - excel

I have an Excel sheet with monthly costs per food. The goal is, on a part sheet, to calculate the value of each food in every month. With a formula I am using at the moment =SUM(VLOOKUP (A3; Food! C3: K3000; 7; 0)), it is only looking for a relative value in the first month and not in the total of all months.
To clarify the formula:
A3 is the food I'm looking for;
Food! C3: K3000 is the range of the table where I am looking for the data;
Finally, 7 will be the column index where the amount spent per month is.
This is what I have in Food sheet:
I think there is no extra information. If something else is left, please tell me.
That's the result I want:

You can use SUMIF:
=SUMIF($B$3:$B$11;G3;$C$3:$C$11)

Related

Excel Formula to calculate Average rating out of 5

I have a table of data where ratings are given as V good - 3, Good - 2, Avg - 1 but if the value is NA I want to exclude that from Avg.
I do have values stored as Good, V Good, Avg against the record.
Any excel formula for this to calculate rating out of 5.
Thanks in advance.
Please try this formula. It's designed for entry in a cell in row 2 from where it can be copied down.
=IFERROR(SUMPRODUCT((COUNTIF(C2:E2,{"V Good","Good","Avg"})*{3,2,1}))/SUMPRODUCT((COUNTIF(C2:E2,{"V Good","Good","Avg"}))), "NA")
There are only 3 columns in your example. Therefore I don't understand your request for a "rating out of 5". However, you can use the same formula on a larger range, of 5 or more columns. Just change both range references to include more columns, like E2:G2. The important thing is to change both to the same size of range.

How to have a running total in Excel

How do I get a running total for a row I will only have partial data for?
In Column I of my example (Running Total Comparison), I would like to compare the sum of the cells I have information for in Sales Week 2 (B3:D3) with those same cells from Sales Week 1 (B2:D2). If I add data to E3, I would then need to compare the sums for (B3:E3) and (B2:E2).
For Sales Week 1,
=sum(b2:index(2:2, match(1e99, 3:3)))
For Sales Week 2,
=sum(b3:index(3:3, match(1e99, 3:3)))
You can also use this formula in cell I2, then drag it to the bottom...
=SUM(OFFSET(B2,0,0,1,LOOKUP(2,1/($B$3:$H$3<>""),COLUMN($B$3:$H$3))-1))

Need help in excel formula

1) I have two tables. 1st table contains data for more then 20,000 rows and 2nd table I already have the following columns details i.e. Region, Item, Number and I just have to get the Total value of the product from the 1st table
2) There are two types of prices in the 1st table . One is Retail Price and Another one is a Wholesale price
3) In each of the regions Rep, Item and Numbers are same in most of the cases, but the Total price is different
4) I am able to get the Total price details in 2nd table through vlookup formula (After concatinating the following columns i.e. Region, Item and Number from both the tables) wherever there is an account number for retail price
5) Currently I am manually updating "Total Price" details in 2nd table for Wholesale price which is taking lot of time.
Is it possible to build a formula to get the wholesale price details in the 2nd table, since there are more then one account number, but the price is same
If the wholesale price is the lowest price for the specific item, then you can find it with the formulas MIN and IF.
Based on your screen shot:
D is the column with the list of items
I5 is the cell with the item name for which you want to find the wholesale price
F is the column with the list of prices
If you enter the following formula in cell K5, it should find the lowest price for pencils
=MIN(IF(D:D=I5,F:F))
On this link, there is an explanation if you want to use multiple criteria.
http://www.contextures.com/excelminmaxfunction.html
try the sumifs function.
It takes multiple arguments and criteria. So it should look something like:
cell value at j5 = sumifs(f3:f23, b3:b23, h5, d3:d23, i5....)
you need to mark off which rows in your first table are wholesale selling. So it should be a column of some kind. Once you do that, let's say in column G, then you add onto the sumifs function...
, g3:g23, L5)
What you're doing is summing up all of the values in column F where h5 (region) matches in b3:b23, i5 (item) match in d3:d23, and where L5 (retail type) match in a new column g2:g23.
This will find all of the values that match that criteria exactly.
Vlookup is useful, but it's harder to scale IMO than the advanced if functions.
SUMIFS is probably the better way to go on this one, but as an alternative there is also SUMPRODUCT.
=SUMPRODUCT(($H3=$B$3:$B$20004)*($I3=$D$3:$D$20004)*($J3=$E$3:$E$20004)*($F$3:$F$20004))
The * acts as an AND statement in a logical check, and each of the ($H3=$B$3:$B$20004) is a logical check. When the row is true it will evaluate to 1. When it is false it will evaluate to 0. in the end you wind up with a list of prices or 0s that get summed. The end result is the sum of everything that matches your criteria.
The danger of using this formula is that it can get labour intensive as it is performing array calculations without being an array formula.

Calculate updated workdays from today

I have the following formula:
=NETWORKDAYS.INTL(C7,TODAY(),$E$2:$E$500)
Which I want to calculate the working days from the starting of the month (c7) to present day today. However I am getting a #num error any suggestions?
Example.
6/01/16 - today (6/21/16) = 15
tomorrow
6/01/16 - today (6/22/16) = 16
I'm doing a sales per day average that's why I would like it to update based on the date.
Assuming your data is in column A and you want result in column B. Place this formula in Cell B2 and drag it down.
=NETWORKDAYS(A2,TODAY())
Here is the data that I've used.
In cell B4, I have added +1 in formula just to show you the result based on tomorrow's date.
You will need to change the reference.

Excel | Formula to find total amount in this situation

Assume that we are currently in the month March. I have a table with all the months and a list of products. Inside each column i have the number sales a product has made on that month, like so:
Notice i have a cell containing "Total until current month". I would require a formula to find out the total amount of sales of a specific product (product A for example) up until March (current month) as you can see with the manually typed 6, 1 in Jan and 5 in Feb.
I would usually do this by finding the sum of cell C4 and D5. But this should be 1 dynamic formula that is updating as we progress onto next month. So as an exammple, in April, it will find the sum of cell C4 - E5 (Jan - March) and update the value.
Is this possible?
Regards
Put a helper row above the month names that has the month numbers 1-12.
Then use SUMIFS():
=SUMIF($C$2:$N$2,"<=" &MONTH(TODAY()),C4:N4)
You could hide that row so it is not visible and not readily accessible.
In row 3 put month numbers. Now if in cell Q4 you have a month number that you want to relate to use:
=SUMIF($C$3:$N$3,"<"&$Q$4,C5:N5)
for sum of A and drag down for other products.
If you want to pick the product you want sum for and have it all in one cell, then assuming that in cell R4 you have your product name (e.g. "B") write
=SUM((C3:N3<Q4)*C5:N6*(B5:B6=R4))
and press ctrl+shift+enter.
The simplest solution is to leave E4 through N4 empty. Only put a value in E4 once March is complete and you have a value for March. This will allow a formula like:
=SUM(C4:N4)
for Product A

Resources