Sum if month is June and row text contains - excel

I'm hoping someone can help with a formula to input the value of Testing for June in cell A20 (FOR EXAMPLE).
So first criteria is the month as Jun-21 and then the next is the word testing.
I need more than a basic sum function as it needs to include the total purely based on the month and the name

If you need to lookup a value using both the row label and column label, using index/match is the formula to use. I assume you only have two different table, so this formula looks up the number in the first table, then looks up the value in the second table and adds them together.
=INDEX(J3:P8,MATCH(B12,J3:J8,0),MATCH(B13,J3:P3,0))+INDEX(A3:G8,MATCH(B12,A3:A8,0),MATCH(B13,A3:G3,0))

Thanks heaps for that!
How about if it were two tables but only some items are in each. So say if testing was only in one table but passing is in both - I hope to be able to use the same sum for all so is there something I can add in to the formula so it knows to just include the one total if it can't see the name testing in the other table?
Would it be somehow incorporating a lookup instead?

Related

Large if, but need to match a name base on criteria

I have a table like this (Sheet2):
Where im gonna be adding next columns in the future.
The thing i want to do is, create a small table with TOP 10 users (Sheet1), base on the criteria which is date in cell B2.
Like that:
I've manage to retrieve TOP 10 scores based on criteria (cell B2)
=LARGE(IF(branch_units!$C$2:$O$2=$B$2,branch_units!$C$3:$D$48),D3)
But i really can't match names with the score.
Is it possible? Can someone try to explain it to me with an example? Thank You all.
You can use INDEX/MATCH like below
=INDEX(Branch_units!$B$3:$B$8,MATCH(F3,Branch_units!$C$3:$C$8,0))
If you want to select columns dynamically based on date then use below formula.
=INDEX(Branch_units!$B$3:$B$8,MATCH(F3,INDEX(Branch_units!$C$3:$G$8,,MATCH($B$2,Branch_units!$C$2:$G$2,0)),0))
So, when you change date on B2 cell, your score column will change and still you will get name for that changes.

Sum.if, without nesting 12 sum.if functions

I have a problem with an excel function, i "inherited" from a former colleague.
I have the two tables below:
My goal is to get the green field in Table 2 to show the sum of Person1s earnings from January to December. If months was =11 in Table 2, it should show the sum of Person1s earnings from January to November.
My current formular is a lot of nested "If" and "Sum.if" functions, but i wish to shorten it. Is it possible. I tried to say the sum area in the Sum.If to be all columns with data, but it still just returns the one from january (the first one it finds, i guess)
I hope someone can help me! Sorry for my bad english, but i'm not a native speaker
Best regards
Edit: Current formula by request
=IF(A2=0;0;IF($I$1=1;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L);IF($I$1=2;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M);IF($I$1=3;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N);IF($I$1=4;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O);IF($I$1=5;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P);IF($I$1=6;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q);IF($I$1=7;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R);IF($I$1=8;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S);IF($I$1=9;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T);IF($I$1=10;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U);IF($I$1=11;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U)+SUM.IF('Earnings'!A:A;A2;'Earnings'!V:V);IF($I$1=12;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U)+SUM.IF('Earnings'!A:A;A2;'Earnings'!V:V)+SUM.IF('Earnings'!A:A;A2;'Earnings'!W:W);"")))))))))))))
In B16, enter formula :
=SUM(OFFSET(B2,MATCH(A16,A3:A9,0),,,C12))
SUMIF is used to add the contents of a single column that match the criteria.
To achieve what you want, try this:
To shorten the formula significantly
=SUMPRODUCT(($A$3:$A$9=$A$14)*(B3:K9))
I have guessed your row and column numbers, but if you can't get it working just post your row and column headings and I will troubleshoot it.
Alternatively, if you would like to add another table with cumulative earnings, you could do it quite easily.
To provide cumulative earnings for each month for each person
For example, in B15 (or whatever the reference, we can't see your row/column number) you could have "Cumulative Jan", then fill right for a column for the cumulative earnings for each month. In that case B15 would say:
=SUM($B3:B3)
Then fill right and down.
This gives you cumulative earnings for any month for any person, in a table.
You could then do a lookup to that table if you wanted to, to return the matching value given the two inputs of person and month number.

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")

Find all matching categories, there equivalent value, and only grab the values for that month? Images attached to help understand

I am trying to create a budgeting spreadsheet, I nearly have it all working except one function.
Monthly Budget Sheet: http://i.imgur.com/uLJ1AfA.jpg
In this I am trying to read all data on my Transactions Sheet column B: http://i.imgur.com/0SaWEqa.jpg
if they match the Category I have in Monthly Budget B column, I grab the value from Monthly Budget column C and add them up in Transactions column D.
This is my current function: =sumif(Transactions!B:B,A4,Transactions!C:C)
Hopefully my pictures explain what I am talking about. My issue is I also want to filter it so it only adds the values of the ones for that month. E.g. the column 'Actual' in Monthly Budget should grab the value of Eating Out categories in Transactions ONLY IF they are in January, so the first 2 in the image but not the third.
So basically I need to add some way to modify =sumif(Transactions!B:B,A4,Transactions!C:C) so that it will only take entries between 01/01/2014 and 31/01/2014.
Thanks in advance!
use the Month() formula
i think it would be alot easier if you add another column(B) on the transaction sheet after date called month( hide it if you like)
=CONCATENATE(MONTH(A2),"-",YEAR(A2))
then use the SUMIFS function to add up based on 2 criteria
=SUMIFS(Transactions!D:D,Transactions!C:C, A4 ,Transactions!B:B, "1-2015")

Resources