Detect running competition winner`s starting number in Excel - excel

I have a task in in excel and I can`t think of the solution right now.
So I have a spreadsheet with running competition results: The table looks like this
So I need to detect which is the fastest runner that has ran all 3 laps (the winner) and detect the number(Nr) of the winner.
The F column is for calculations if needed
So I detected who had ran all 3 laps with this formula:
=IF(COUNT(C2:E2)>2;SUM(C2:E2);"DNF")
Then I determined who is the winner by running a min formula:
=MIN(F2:F79)
Now I need to detect what number the winner has, So it will be in the A column and in the same row where the row where =MIN(F2:F79) result is.
This is an task so manually finding it won`t work this time.
It is probably a really simple solution but I can`t think of it right now so it would be really nice if somebody could help out.

You can achieve this utilizing Index - Match.
The formula you would place in cell H2 would be as follows:
=Index($A$2:$F$79,MATCH($G$2,$F$2:$F$79,0),1)
What this does is it looks at the whole table and takes the Winner total time (cell G2) and matches it with the corresponding value in Column F, and then returns the first column (Column A).

Related

Look for a value a cell above

I'm looking for a formula or a VBA code for the following problem.
I need to get the total operational hours in a day (J). This is de difference from the start-up time (I) and the shutdown time (K) over the whole day.
Most of the entries are 2 a day, but as you can see in the picture this one has 4. Previously I had the formula in J : =IF(K49="";0;IF(EXACT(A49;A48);(K49-I48);(K49-I49))) But with 4 entries this does not work anymore (the A49 and A28 are just numbers if they are the same it means that it is the same day)
So where I'm basically looking for is that it will take the shut downtime and looks for the first value in I and that it is calculating the difference in J.
Referring to another cell can be done, using OffSet(Row, Col). In case you need the cell just above, you use OffSet(-1,0).
I would just use some nested IFs to check first the row above, then the one above that, then the one more above.
Something like this (sorry, I cannot embed images):
https://i.stack.imgur.com/XLHVO.png

Moving two MS Excel cells that depend on each other

I have a table where I enter the qualification times manually Name and Timer. It calulates the Final Time automatically, but I want it to sort the Final Time and Name in the right side from the fastest to the slowest, as in the second image. I tried using VLOOKUP and INDEX, but didn't manage to get it. I need help finding the right formulas to Cells I$ and J$. I hope to get a answer from here.
Hope to get it like following:
Use this formula in your column J. Enter it in J3 and copy down. As you see, it refers to column H where it expects the numbers 1 and up. So, it will look for the smallest, second smallest etc values in the given range.
=SMALL($D$3:$D$6,H3)
In I3 please enter the formula below and copy down.
=INDEX($B$3:$B$6,MATCH(J3,$D$3:$D$6,0))
It looks for the value the SMALL function extracted and finds the matching name.

Using COUNTIF but not including blanks with other formula

Firstly, apologies if this is covered somewhere deep within the site, I have looked through a lot of other posts and none of the solutions have worked for me.
I'm creating a workbook for a local league I'm involved in and this is the only sticking point I'm coming up against.
In cell J55, I have the formula:
=IF(C11=H55, COUNTIF(D11, "="&E11),0)+IF(C19=H55, COUNTIF(D19, "="&E19),0)
(I've simplified this to only look at rows 11 & 19 for the purposes of this question)
So what I'm essentially saying is if the team name is equal to the corresponding name in the table, count if the scores for both teams are equal. Basically I'm trying to get the number of games that end in a draw.
So at it's core, my formula is looking for whether 2 cells are equal. This is fine, other than it is counting even if the score cells are blank.
So if you refer to the below image, in J55, I'm getting the returned value of "2". However for the values I've populated in the results (just the scores in the first game) it should be returning a value of "1".
If anybody can help in any way it would be a great help.
To count the number of Draws this formula which performs array like calculations will count the number of occurences where where the team name in H55 is equal to the team name in column D or F and when the scores in column D and E are equal:
=SUMPRODUCT((($C$11:$C$21=H55)+($F$11:$F$21=H55))*($D$11:$D$21=$E$11:$E$21)*($D$11:$D$21<>"")*($E$11:$E$21<>""))
Copy down as required.
COUNTIFS options
Based on your formula above, adding the checking for not blank cells using COUNTIFS.
=IF(C11=H55, COUNTIFS(D11, "="&E11,D11,"<>"&""),0)+IF(C19=H55, COUNTIFS(D19, "="&E19,D19,"<>"&""),0)
COUNTIFS is probably the slightly better option as it does not use array calculations. However for a small data set it wont make a noticeable difference in calculation time for most users.

EXCEL calculating average with OFFSET (coord unspecified) of a given keyword

Fun situation I'm trying to calculate. Basically in one row I have names of products, and the row to the right of it the number of days that have passed since the product was first received.
The calculation to do the days for ex is
=TODAY()-BB2
What I'm trying to do NOW, is identify let's say the product word "truck," and then calculate how many days on average the holding time of truck is.
I understand the logic of the formula I need, just not how to execute precisely. Basically the formula is going to need to use this average calculator with a keyword identified COUNTIF
=COUNTIF($A$2:$A$900,"TRUCK")/COUNTA($A$2:$A$900)
What I'm missing is some type of...IF "TRUCK, OFFSET (GIVEN CELL) -1)
Thanks for any thoughts!
-Wilson
A formula (in C1 in the example):
=AVERAGEIF(A:A,"truck",B:B)
should work but I would recommend a PivotTable for the additional functionality it provides:

Excel: How do I sum cell values every nth colum

I have the following table:
and I'd like to have the total for each player but values are every 3 columns.
As you can see from the picture on the bottom part I wrote what manually I should enter.
For player 1
=SUM(D3;G3;J3...)
Player 2
=SUM(D4;G4;J4...)
and so on. What formula should I use to calculate automatically every 3 columns? I know how the MOD works but on the net I found too many examples each one using different methods and none worked so far. Can anyone help me please or point me to the right direction to understand how it works to get this data since I'll be using this a lot (get value from cell every nth column).
thanks
It looks like you should just be using SUMIFS here:
=SUMIFS(3:3,$2:$2,"TOT")
This will sum every value on row 3 (Player 1) where the value in row 2 is "TOT" (every 3rd column). Put this in cell B18 and just copy down in your column B.
Or, in case you change your column labels, you can refer to cell D2 instead of typing "TOT" in the formula:
=SUMIFS(3:3,$2:$2,$D$2)
Try this, it will total all the cells that occur every 3 columns beginning at column D. Z3 can be increased to any column you require:
=SUMPRODUCT((D3:Z3)*(MOD(COLUMN(D3:Z3)-1,3)=0))
The explanation on how it works can be found here (I advise you to bookmark this site for future references. They have many other helpful formulas and functions).
Applying this formula to your reality should be something like this for Player 1 (Not tested. Adjust the ranges as required):
=SUMPRODUCT(--(MOD(COLUMN(D3:Z3)-COLUMN(D3)+1,3)=0),D3:Z3)

Resources