Nesting Excel Score - excel

For a project we are making an Excel file for the WK in Russia.
So I need the following things (if its possible only nesting):
TOTO: the home team wins = 1, away team wins = 2, its equal = 3
This is what I have right now for these:
IF(F5<H5;"2";IF(F5>H5;"1";IF(F5;"3";IF(H5;"3";""))))
This works but if I set the score 0-0 then I get 0 back in stead of 3.
Then the next one:
If they gambled that the home team score is correct they get 2 points,
If they gambled that the away team score is correct they get 2 points
If they gambled that the TOTO is correct: 5 points
If all is correct: 1 bonus point
What i mean with the second thing is if somebody says that the score is 2-1 and the game ends on 0-1 then i get 2 points (one for the TOTO and 1 point for the team that scored 0-1).
E.g. Belgium-Tunis (player1) on 2-1 with TOTO = 1. Game ends on 0-1. Player1 gets 2 points in total because he predict the goals of Tunis correct.
Last but not least:
IF the teams are going to the quarter finals,... are coming a few lines on it:
Country good: 10 points
European champ correct: 25 points
Total yellow: 20 points
TOtal red: 20 points.

I believe the formula you want for the first of your questions (the home team wins = 1, away team wins = 2, its equal = 3) is:
=IF(F5<H5,"2",IF(F5>H5,"1",IF(F5=H5,"3","")))
Not sure why you have the numbers in speech marks (have left as is in the above) you could have:
=IF(F5<H5,2,IF(F5>H5,1,IF(F5=H5,3,"")))
Which would probably be easier if you want to do any maths with the values.
It's not entirely clear what you're asking with the rest of the question(s).

Related

Spotfire - Count the number of wells over time

I am new to spotfire so please bear with me. I have a simple problem i hope. I have a display that has well production vs time. All I need is count the number of active wells as a function of time. The number of wells in month 1 = 95 but as we approach month 60 only 3 wells are active.
The well name = API14
The columns that a plotted are Oil and Months , Line by API14
I have tried
UniqueCount([API14]) OVER (Intersect(All([Axis.Line]))) AS [Cumulative Count]
This one gave the total unique API14 over time (95 in this example - light blue line) and not the declining well count as a function of time. Any help?
Try:
UniqueCount([API14]) OVER (Intersect([MONTHS],All([Axis.Line])))

Optimal distance with dynamic programming

Okay, so honestly this is a homework question, but I really did my best to find the solution, and I think I partially did.
The question:
We are given a series of cities whose positions are symbolized with only one coordinate and we are supposed to implement a given number of hospitals to cities so that the sum of each cities' distance to nearest hospital will be minimum.
That is, if we are given the cities at 1, 3, 5, 7, 9, 11, 13 and if we are going to put 3 hospitals, the hospitals will be at 3, 7, 11 (actually there could be multiple best solutions for this one, did not check).
We are advised to use dynamic programming and first check the case in which we implement only one hospital.
I've figured out finding the subsequent hospital's location. I create a table, and of cities. Then to each cell, I put either the city of the current rows' distance to closest hospital that already build or city's distance to city of the corresponding column.
For example, if we already implemented a hospital to 1, it would be like:
*-1-3-5-7-9-11-13
1|0|0|0|0|0|0||0|
3|2|0|2|2|2|2|2|
5|4|2|0|2|4|4|4|
..............
then sum the columns and find the next hospital.
The problem is, I cannot figure out the first hospital that I'm supposed to build!!
When I manually add one of the element of the actual solution, I can get the right answer so my partial solution should be true.
BTW complexity should be O(CityNum^2), hospitalNum is a constant. So I can't use bruteforce.
An example input and output (from the homework assg):
Input:
10 5 (10 is city num, 5 is hospital num)
1 2 3 6 7 9 11 22 44 50 (coordinates)
Output:
9 (sum of minimum distances)

Excel IF OR Statement

I am having trouble determining the correct way to calculate a final rank order for four categories. Each of the four metrics make up a higher group. A Top 10 of each category is applied to the respective product to risk analysis.
CURRENT LOGIC - Assignment of 25% max per category.
Columns - Y4
Parts
0.25
25
=IF(L9=1,$Y$4,IF(L9=2,$Y$4*0.9, IF(L9=3,$Y$4*0.8, IF(L9=4,$Y$4*0.7, IF(L9=5,$Y$4*0.6, IF(L9=6,$Y$4*0.5, IF(L9=7,$Y$4*0.4, IF(L9=8,$Y$4*0.3, IF(L9=9,$Y$4*0.2, IF(L9=10,$Y$4*0.1,0))))))))))
DESIRED...
I would like to use a statement to determine three criteria in order to apply a score (1=100, 2=90, 3=80, etc..).
SUM the rank positions of each of the four categories-apply product rank ascending (not including NULL since it's not in the Top 10)
IF a product is identified in more than one metric-apply a significant contribution weight of (*.75),
IF a product has the number 1 rank in any of the four metrics-apply a score of (100).
Data - UPDATED EXAMPLE
(Product) Parts Labor Overhead External Final Score
"XYZ" 3 1 7 7 100
"ABC" NULL 6 NULL 2 100
"LMN" 4 NULL NULL NULL 70
This is way beyond my capability. ANY assistance is appreciated greatly!!!
Jim
I figured this is a good start and I can alter the weight as needed to reflect the reality of the situation.
=AVERAGE(G28:I28)+SUM(G28:I28)*0.25
However, I couldn't figure out how to put a cap on the score of no more than 100 points.
I am still unclear of what exactly you are attempting and if this will work, but how about this simple matrix using an array formula and some conditional formatting.
Array Formula in F2 (make sure to press Ctrl+Shift+Enter when exiting formula edit mode)
=MIN(100,SUM(IF(B2:E2<>"NULL",CHOOSE(B2:E2,100,90,80,70,60,50,40,30,20,10))))
Conditional Formatting defined as shown below.
Red = 100 value where it comes from a 1
Yellow = 100 value where it comes from more than 1 factor, but without a 1.

calculating basic formula if and or

Sheet Participants:
Sheet Actual Results:
What I am trying to do is for the Participants sheet to look up the actual results sheet
My formula to display the outcome (this doesn't work correctly)
=IF(AND(B2='Actual Results'!B1,
C2='Actual Results'!C1),
"CORRECT SCORE & RESULT",
IF(AND('Actual Results'!B1>'Actual Results'!C1,
Participants!B2>Participants!C2),
"CORRECT RESULT",
"INCORRECT RESULT"))
The reason its not working 100% is because when the greater than comparisons in the formula come into play and the team in column D in actual results has more goals then its not working. If I change the greater thans to less thans, then it works, but this won’t be consistent.
Look up score in B and C (Participants).
IF Scoreline is correct - 5 points
If result is correct but not scoreline – 2 points
If winner is not correct - Minus 1 point
Example:
If actual was 0-0 and prediction is 0-0 then 5 points… if prediction is 1-1 , then 2 points still. Works the same for an actual result draw.
change
AND('Actual Results'!B1>'Actual Results'!C1,
Participants!B2>Participants!C2)
to
OR(AND('Actual Results'!B1>'Actual Results'!C1,
Participants!B2>Participants!C2),
AND('Actual Results'!B1<'Actual Results'!C1,
Participants!B2<Participants!C2),
AND('Actual Results'!B1='Actual Results'!C1,
Participants!B2=Participants!C2))

Dynamic Shift Rota Advise

I am stuff on a problem regarding setting up a dynamic shift rota at work.
What it has to do is there are 3 people per team and 3 jobs to do (which they do as equals as it can be per week) and when someone is off lets call it job 3 is just not done that day.
I have been able to make it to set true or false if there in but having trouble with assigning a different job per day with priority on job numbers 1 and 2.
edit: I thought I would explain it better what I am looking for
alt text http://img688.imageshack.us/img688/3032/spreadsheet.jpg
This is the spreadsheet i have at the top is the rota 1 = in 0 = day off
I have only been working on Group 3 to get it working, In the grey next to the days at the bottom are the jobs in which that person would be doing if it was a full staff day.
What i need to do is if there are only 2 people in then they do job number 1 and 2 alternativly .
i currently have this formula it works for some combo but not all (this is formula for H33)
=IF(F9 > 0, IF(OR(F9=0,F10=0,F11 = 0),IF(OR(I33 = 1, I33 = 2),I33,I33-1),I33), 0)
Any advise woudl be great
Use this formula for John (column C row 4), and the copy it down to the other 2 people in the same day
=IF(B4="in",COUNTIF(B4:B$4,"in"),"")
for next day you should change the B$4 to B$8, etc
EDIT / I did not undestand your rotation pattern
Now, refering to the excel image you posted, for Group 1, Monday
You need two auxiliar columns
1. In P11-> =D3*E23 // To eliminate zeroes
2. Copy down P11 till P13
3. In Q11-> =IF(P11=0,"",RANK(P11,P$11:P$13,-1)) // To get 1, 2 or 3 values
4. Copy down Q11 till Q13
5. In D23 -> =IFERROR(Q11-MIN(Q$11:Q$13)+1,"") // Offset Factor 1,1-2,1-3
4. Copy down D23 till D25
It was a tricky one

Resources