Determining a value depending on where you are on a list in Excel - excel

I am tracking the progress of students reading books in class. For the number of books they read they get a reward. It is not 1 book = prize, 2 books = prize. Instead there are dead spaces along the way, for example there is no reward for books 3 and 4 but there is for 5 books. I want to be able to input the number of books each student read and have it update as to what the next reward will be. For example:
List one
Name Books Next Tier Prize
Sally 4 5 Candy Store
Luke 1 2 Extra coloring time
Jane 8 10 10 Extra minutes on the playground
And so on
The table for rewards would be
Books Prize
1 Ribbon
2 Extra coloring time
5 Candy Store
7 Prize bucket
10 10 Extra minutes on the playground
And so on
This is just an abbreviated list and I have used if then statements previously. However the previous list that had 18 values was cumbersome as it was, the new list has 35 values.
I have used if/then statements in the past in combination with vlookup, but with the increased number of values, it just seemed daunting. I could still use an if statement but was hoping there would be an easier way.

Put this in C2 and copy over and down:
=INDEX(F$2:F$6,IFERROR(MATCH($B2,$F$2:$F$6),0)+1)

Related

Is there any way to seach for coincidences in Excel, in order to know how many times two different values have the same ID

I have a two tables like the following:
This is the first table. Here, I have an ID to refer the log, and some data about that particular register.
ID
Content
1
Rock
2
Dust
2
Rock
2
Sand
3
Dirt
3
Sand
4
Rock
5
Rock
5
Sand
5
Dirt
This is the other table, that I want to create.
Rock
Dirt
Dust
Sand
Rock
NA
1
1
2
Dirt
NA
NA
0
2
Dust
NA
NA
NA
1
sand
NA
NA
NA
NA
In summary, I want to create some kind of table that displays how many occurencies appear of two different elements with the same ID. In the example above with the table, if you imagine a really big database, I want my second table to display how many times "Rock" and "Sand" were together.
Btw, if you notice, half of the table is filled with "NA". That's because the table is mirrored. Also I unable the midline because, in my case, I don´t need to know if in the same log has two times the same element.
Also, I have noticed that my second table isn´t very effective, I mean, the last row is usless if you see. Could you thing a better way to do the thing that I want?
I tried to use querys, formulas, and a combination of them, but I didn´t figured out how to do it.
This was not a quick fix. Took many hours.
=IF($D2=E$1;"";SUM((FILTER($B$2:$B$11;ISNUMBER(MATCH($A$2:$A$11;TRANSPOSE(FILTER($A$2:$A$11;$B$2:$B$11=$D2));0)))=E$1)*1))
or with LET:
=LET(ID;$A$2:$A$11;Content;$B$2:$B$11;IF($D2=E$1;"";SUM((FILTER(Content;ISNUMBER(MATCH(ID;TRANSPOSE(FILTER(ID;Content=$D2));0)))=E$1)*1)))
To avoid dublicates you can arrange your data like this:

Why is the result of this "countifs" formula = 0?

My goal is determine how many times a given teammate is matched up with another given teammate over 3 rounds of golf played by 3 different teams. The same roster of 12 players is changed up each round. The goal is to minimize the number of times the players are paired up with the same people over the 3 rounds.
I attempted to use the COUNTIFS formula in excel, but it returns 0 when checking if the name of each player is in the same "Team" range.
In my sheet, i have a table for players to show how many times they are paired up with different people in the 3 rounds. I can't even get it to calculate the matchup from Team 3 in Round 1 (Mike & Matt paired up), let alone move on to summing up the entire set of data.
From the screenshot you can see my equation =COUNTIFS(Q3:Q6,S3,Q3:Q6,T1) in cell T3, referencing the data in Q3:Q6 for the names Mike and Matt.
I've reviewed plenty of examples using COUNTIFS from other types of information/data types, so I don't understand why my formula fails. When I replace one of the cell references to a name with a wild card * then it returns a result of 1. If I take out one of the two references all together it returns a result of 1, for the player name that remains.
=COUNTIFS(Q3:Q6,S3,Q3:Q6,T1)
Q3:Q6 is the table I'm referencing at the moment. The same table is referenced for both players. S3 is Mike and T1 is Matt. Both players are listed in the reference range, so it seems to me that the condition is satisfied for both components.
I don't get any error messages, just a result of 0 when I'm expecting 1.
Because COuNTIFS() is AND not OR So the cell would need to be both Matt and Mike at the same time, which is not possible.
To do OR we need to do something slightly different:
=SUMPRODUCT(COUNTIFS(Q3:Q6,CHOOSE({1,2},S3,T1))
This will return 2 if both are in the range so to get it to 1 we do:
=--(SUMPRODUCT(COUNTIFS(Q3:Q6,CHOOSE({1,2},S3,T1))=2)
Which will now return 1 if both are found in the range and 0 if only one or none are found.
So we can string 9 of these together to get the output you want:
=(SUMPRODUCT(COUNTIF($M$3:$M$6,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($O$3:$O$6,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($Q$3:$Q$6,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($M$10:$M$13,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($O$10:$O$13,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($Q$10:$Q$13,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($M$17:$M$20,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($O$17:$O$20,CHOOSE({1,2},T$1,$S2)))=2)
+(SUMPRODUCT(COUNTIF($Q$17:$Q$20,CHOOSE({1,2},T$1,$S2)))=2)
It will now count how many times the pairs were on the same team:

Subtract two range values for matching ones excel

I have come across of the problem that, I don't know how to solve in efficient way. So I have two tables like these:
Table 1
Company Score
Apple 10
Banana 5
Kiwi 4
Pineapple 2
Table 2
Company Score
Apple 4
Pineapple 3
Kiwi 2
Strawberry 1
Then in my result table in which I have company names listed in one column, like below. Right next to this I would like to show the differences which should be the first table values - the second table values where company names match(the list can be in different order that is why, I need to check it before subtracting).
Table 3
Company Result
Kiwi 2
Apple 6
Banana -5
Pineapple -1
I can do this with nested IF function to check every cell one by one, but I assume there might be more efficient way. I wonder if you have one.
Thanks to #ScottCraner's comment, I solved it with two sumifs subtracted from one another with this formula. I entered this in Column D66 and dragged down
=SUMIF($C$36:$C$45;$C$66:$C$75;D$36:D$45)-SUMIF($C$51:$C$60;$C$66:$C$75;D$51:D$60)
1st Sum if: Where C36-C45 is my first list of companies, C66-C75 is the list of companies that I have in the results table, D36 -D45 is the score list from the first table.
2nd Sum if: Where C51-C60 is my second list of companies, C66-C75 is the list of companies that I have in the results table, D51 -D60 is the score list from the second table.

Equal distribution formula based on preset values. Excel

e.g. There are 300 apples. There are 100 people. Each person has a preset value (represented as a number 1 to 5). 1=1 apple, if their value is 5 they get 5 apples etc. But there are 300 apples available so each person is going to get more then the value says they "deserve". Or one day there are only 200 apples and every one gets less then what the value states says they "deserve". Is this possible in excel?
NAME VALUE
john 5
james 5
sam 4
matt 5
mike 3
steve 2
etc...
This absolutely sounds like a perfect problem for Solver to handle. As you know, this in included within Excel's addins. It can deal with all the variables you mentioned.

sports scoring in multiple phases in excel

I have a question about excel.
There is a sports tournament with multiple phases. And the results page looks something like this:
rank phase1 phase2
1 TOM ALBERT
2 MATT TOM
3 ROBIN MATT
The first place gets 5 points, second 3 and third 1 points.
So the summary I would like to get is like this
rank name phase1 phase2 total
1 TOM 5 3 8
2 ALBERT 0 5 5
3 MATT 3 1 4
4 ROBIN 1 0 1
I cant figure out how to generate it simply, so if I copy-paste the results from phase3 to somewhere in my excel sheet, the summary page would also update.
If you can support me with advice or just a working template, I would be thankful!
Thank you for your time!
I've done you a basic example below...just list all 50 players in the summary page and copy the formula down as it is - as per the question it only records a value for the top 3 places, hope this helps if not please let me know :)
Example file here
Assuming the structure you defined and that when you paste phase 3 it will have its header ("phase3") on the same row as the other results, you could have the following formula on your Table 2:
{=SUM(IF(IFERROR(MATCH($B2,INDIRECT("Sheet1!"&CHAR(64+MATCH(C$1,Sheet1!$1:$1,0))&":"&CHAR(64+MATCH(C$1,Sheet1!$1:$1,0))),0)-1,0)={1,2,3},{5,3,1},0))}
Note: entered as Array formula: CTRL + SHIFT + ENTER
Formula uses the Table 2 headers ("phase1","phase2", etc.) and the players names to find the results for each phase. It then uses the predefined arrays that determine points given per position. The final sum is to bring the result that are in array (other values in array are 0) into single value.
Total would sum results per player.
Under the rank cells you would place the following formula:
=RANK(F2,$F:$F)
Which would provide you the rank of each player (Column F containing the totals).
Note that this would not sort your rank automatically but you could easily do this with Sorting or Autofilter. Hope this helps. Cheers.

Resources