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

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.

Related

Rank based on filtered Date

just trying to overcome that ranking problem and i stuck to find the solution for it.
Basically, i would like to rank on below based on Date filter on Cell C2.
But only want to start the ranking from cell A20 when it matches with the filtered Date.
Also increment identical values on "Prob" column by one
is there any way to do it please?
Use COUNTIFS with a relative reference:
=IF(AND($A6=$C$2,$B6<>""),COUNTIFS($A$6:$A6,$C$2,$B$6:$B6,"="&$B6)+COUNTIFS($A:$A,$C$2,$B:$B,">"&B6),"")

Sum if month is June and row text contains

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?

Generate or fill cell data based on another dataset excel

I've a data set that shows;
employee name
date
time work started
time work ended
Now I am trying to have a report like sheet where I can select a certain employee name from a list of employees to view his/her time attended for a particular month.
I tried vlookup but went no where since I need to lookup by two columns plus a row.
Is this possible? without macros or vba.
Thanks
Since name and date are unique identifiers it is possible to use the sumifs function.
For ‘time in’ and ‘Rachel’ this will look as follows:
=Sumifs(column ‘time in’ from data set, column ‘name’ from dataset, “Rachel”, column ‘date’ from data set, “10/01/2017”)
Where Rachel and the date also can be a referenced cell.
=AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1)
The above formula will grab the row number that matches your criteria. to pull the information you want, you can place the row number inside an INDEX formula to get the following:
=INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1))
You can place the above in your first Time cell and copy right and down. You will see errors if criteria do not exist. ie no person of that name or no date data for that person. to avoid this you can wrap the whole thing in an IFERROR like the below:
=IFERROR(INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1)),"Nothing found")
if you would rather a blank than nothing found display change the "nothing found" to "" or 0 if you want 0 to be displayed.
Note: Aggregate is performing array like calculations in this case. As such you do not want to full column references as it will cause a lot of unnecessary calculations to be performed. Because you have unique entries, SUMIFS option given in another answer is a much better choice.
I think a pivot table will do the job for you.
Place the employee name in the filter, place date and
times in the rows.
Remove subtotals from the Pivot Table
Change Table layout to tabular and Repeat rows
Right click on the Time In and select Ungroup
Then you have the image below.
I have the following layout:
In B11 write this formula and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),3)
In C11 write this and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),4)
Note that these are Array-Formulas, so you need to enter them with CTRL + SHIFT + ENTER instead of the normal Enter.
You will get a #NV error if the employee hasn't worked on one of the dates A11 and A12. So you could surround the Formula with IFERROR to avoid this.

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

How do I nest the Cell "Address" Formula into a VLookup? in Excel

So here are the Columns:
Column A: Date
Column B: Prices of NASDAQ
Column C: Prices of ABC Stocks
I want to run a financial beta formula, (=COVAR(C1:C1000,B1:B1000)/VAR(B1:B1000).
But, I don't want the cells to always start from the first row... I want to be able to calculate this formula at different rows.
For example, if I have (=COVAR(C60:C1000,B60:B1000)/VAR(B60:B1000)
I want to be able to make that change by referring to a date in a new cell labeled "Start Date" without rewriting each formula.
I'm thinking of nesting a =Cell("address") formula within a vlookup, but I'm having trouble with this.
Could anyone please help me?
INDEX is usually preferable to INDIRECT for 2 reasons
1.) INDIRECT is a "volatile" function which means that it re-calculates every time the worksheet changes - potentially slowing everything down
2.) With INDEX you don't need to "hardcode" the column letters like "C" so the formula will still work if you add or delete columns.
It would look like this
=COVAR(INDEX(C:C,MATCH(Date,A:A,0)):C1000,INDEX(B:B,MATCH(Date,A:A,0)):B1000)/VAR(INDEX(B:B,MATCH(Date,A:A,0)):B1000)
...or rather than repeating the same MATCH function 3 times you could put the MATCH part alone in a separate cell or make it a named range - e.g. named start and formula becomes:
=COVAR(INDEX(C:C,start):C1000,INDEX(B:B,start):B1000)/VAR(INDEX(B:B,start):B1000)

Resources