I'm trying the get the average value out of this table that has a lot of data in it.
I tried to VLOOKUP function but i can't get it to search on day names :(
If someone could help me that would be much appreciated!!
enter image description here
This basically the same as answer already given but for text and for all averages to return
=SUMPRODUCT(--(LEFT($B$2:$B$15,FIND(",",$B$2:$B$15)-1)=$H2),D$2:D$15)/SUMPRODUCT(--(LEFT($B$2:$B$15,FIND(",",$B$2:$B$15)-1)=$H2))
Put in I2 and drag right and down.
Related
I'm trying to rank the following items based on price using the following formula =SUMPRODUCT(([Item]=[#Item])*([#Price]<[Price]))+1, but it isn't returning any results:
When I use the same formula in the following test table it works, =SUMPRODUCT(($A$2:$A$7=A2)*(B2<$B$2:$B$7))+1:
Can someone please let me know what I am doing wrong? Thanks
EDIT 2 : Evaluation https://imgur.com/a/eXIYPAP
Your formula works fine for me.
Are you sure that A2 and A3 are the same value? There may be some hidden white space causing problems. Just try
=A2=A3
in another cell to make sure they are the same.
USE COUNTIFS INSTEAD
I don't know why your formula isn't working, however, I would suggest avoiding SUMPRODUCT where you can.
=COUNTIFS([Item],[#Item],[Price],">"&[#Price])+1
This will count the number of prices higher than the current one for each item (+1, if you want the rank to start at 1 instead of 0)
If your goal is to get the ranking for each unique item, =SUMPRODUCT(([Item]=[#Item])*([Price]>[#Price]))+1 should do the trick. If the goal is to get the ranking based only on price, don't have it figured out yet.
An excel sheet contains an array of repeating "calendar months" in Column-1, an array of repeating "Company Names" in Column-2, and an array of Numerical Values in Column-3.
(1) What is the sum of all values in Column-3 for any random company for any random month?
(2) what is the sum of all values in Column-3 for any random company up to its previous month?
However, I found the solution for Question (1), but unable to find the solution for Question (2). Thank you very for your help in Advance!
I have uploaded the file.
https://www.dropbox.com/s/31e85g5j0njsxr8/Solve.xlsx?dl=0
Going off my previous answer, give this a shot.
Worksheet here
Let me know if you have any questions.
Since I don't know how your data looks like I'm giving general solution.
It looks to me that you can use a simple sumifs formula for your described problem.
=SUMIFS(D1:D10,C1:C10,"<"&DATE(YEAR(A1),MONTH(A1),1),B1:B10,"="&A2)
Based on my answer to your last question, you can just add other conditions to the SUMPRODUCT like:
=SUMPRODUCT((MONTH(DATEVALUE("01"&A2:A55&"2018"))<MONTH(DATEVALUE("01"&$B$1&"2018")))*(C2:C55)*(B2:B55="XYZ"))
Array Formula: press CTRL + SHIFT + ENTER
I´ve spent a lot of time with a formula in Excel and I´m still blocked. I hope you can help me.
I have a table in Excel with several values as shown in this
screenshot.
What I´m trying to extract is the number of Fruits sold in a specific month. That is, how many lemons were sold in January 2016, for example. This is the formula I´m using:
=SUMPRODUCT((B3:B38=E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
But the result is #N/A as seen in the screenshot.
What Am I doing wrong? Any help, please?
Thanks a lot in advance!
You can use arrays in excel to get this answer
{SUM(IF(MONTH(F$3&"1")=MONTH($A$3:$A$150),IF($E4=$B$3:$B$150,$C$3:$C$150,0),0))}
You can use this Sumproduct formula which uses array logic:
SUMPRODUCT((MONTH($A$3:$A$38)=MONTH(TEXT(G$2,"MMM")&1))*($C$3:$C$38=$F4)*
($D$3:$D$38))
Sumproduct Demo
Part of your problem is your ranges are not equal in length. B3:B38 has to be the same number of rows as $A$3:$A$150 and C3:C150. When rows are not equal things blow up on you.
=SUMPRODUCT(($B$3:$B$150=$E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
if you change your header row to be actual excel date format, and then change the cell display format to just show the month (as suggested by csanjose), then you can adjust your sumproduct formula as follows and copy to all cells in your table.
=SUMPRODUCT(($B$3:$B$38=$E4)*(MONTH($A$3:$A$150)=Month(F$3))*(YEAR($A$3:$A$150)=Year(F$3));$C$3:$C$150)
Fill your month-row with the last day of each month, then apply date format to show only month name.
The formula you should use is, for example, in g8:
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&G$3;$A:$A;">"&F$3)
First column "F" doesn't have a column on the left to compare, so you can put a date in E3 or change a bit the formula (example of F8):
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&F$3;$A:$A;">2015/12/31")
Take a look at the result
If you don't want to use a pivot table, you can use this formula to get what you need:
=SUMPRODUCT(($B$3:$B$150=$E3)*(MONTH($A$3:$A$150)=1)*(YEAR($A$3:$A$150)=2015)*$C$3:$C$150)
Then drag-fill the cell to copy it to every month column (just make sure you change the month number in the formula (and year if you're doing that too)), and then drag-fill down the columns.
That should work pretty food good :)
Good Luck!
I spent half the day racking my brain and playing around with the formulas i know of in the excel world but I still cannot figure out a method to do this without using VBA coding. Hopefully someone out here would be able to help provide some guidance without the use of code.
The scenario is this and refers to the screenshot above:
Objective: Determine the number of non zero values in a particular month's column for every row that has an "exceptions" label.
The month is controlled by the user input cell.
Example:
Total number of non zeros in Feb column is 6.
Actual result that I am expecting: 3 (because there are three rows with "exceptions" label and we should count the total of those rows only.)
I've tried Index/Match/Countifs/lookups but just cannot find the right combination.
Closest I came to was using the screenshot below but that only returns the total number of non zeros in that table.
Just putting the question out there for any of the excel gurus to help.
Appreciate the time and thanks in advance!
Regards,
Stan
If you do not want volatile functions like offset or indirect, you can still do it with index (your formula isn't wrong at all). Just try this:
=COUNTIFS(INDEX(F2:K7,,MATCH(G10,F1:K1,0)),">0",E2:E7,"exeptions")
I have been searching for awhile but was unable to find anything to help solve my problem so figured I would try posting on here for help!
I have attached an image of the table I am working with
Basically I want to be able to query this table by saying I have a value of 36 months (column c) and the sales value is 25000 (row 5) so the answer is C5 (25)
The only answer I can come up with a massive amount of if statements.
Thanks!
This is just a basic 2-way range lookup if you can transform column A into two columns. If you cannot it becomes very messy.
Take a look at this image:
The formula to do what you want with the data organized as in the image is this:
=INDEX(1:1048576,MATCH($C$9,A:A,1),MATCH($C$10,1:1,1))
You can use INDEX and MATCH combination.