After a bit of advice on doing a calculator with a sliding scale.
I am building a matrix where we have set price points at intervals based on qty of items. The code I use works fine apart from the first 2 ranges.
Because for 1 qty the unit cost is so high my maths won't work.
Example
Qty 1 = £23.25 (Price per unit is then £23.25)
Qty 10 = £51.59 (Price per unit is then £5.159)
I then have further quantity's that work out correctly.
What I need to be able to do is some sort of weighted value, for 2 off the unit price needs to be near the £20 a unit mark, then 3 off less etc until I get to 10 off # £5.159 a unit.
(It costs more for lesser quantity's, we want to encourage more qty)
Has anyone implemented something like this? From 10 qty onwards the calculation is fine as the unit cost changes are not much at all.
Thanks
Assuming you have quantities form 1 to 10, in column A, put 23.25 in B1 and 51.59 in B10, then the following formula in B2:
=B1+(B$10-B$1)/9
And populate down to B9
in C1 use the following formula:
=B1/A1
and populate down. Final result should look like this:
You could use vlookup with a table as so:
I'm trying to sort students based off frequency of participation. I have a table that is automatically generated totaling up how often a student has participated in the last few days.
I want it to do 2 things that I can't figure out.
I want it to ignore students that are at 0 removing them from the resulting rankings.
The first number is most important but I want it to reference the next value in the result of a tie.
Short example of table:
Andy - 1 1 2 3
Brad - 0 1 2 3
Cade - 1 2 3 4
Dane - 1 1 1 2
Desired result:
Cade - 1
Andy - 1
Dane - 1
The tie-breaker isn't that important and I figure I can have conditional formatting to remove children at 0, but I still can't seem to figure it out.
The closest formulas I have found in my searching are:
=INDEX($A$10:$A$9,MATCH(ROWS($C$1:C1),$C$1:$C$9,0))
This one doesn't work because it returns #N/A for pretty much all students who are tied.
=IFERROR(INDEX($C$1:$C$9,MATCH(SMALL(NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),ROWS($C$1:C1)+SUM(--ISBLANK($C$1:$C$9))),NOT($C$1:$C$9="")*IF(ISNUMBER($C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9),COUNTIF($C$1:$C$9,"<="&$C$1:$C$9)+SUM(--ISNUMBER($C$1:$C$9))),0)),"")
I had this formula that can handle ties but it needs to be OFFSET but I don't know how since it is an array formula. Also, with both these formulas it reverses the ranks with the lowest values at the top. If anyone could assist me I would greatly appreciate it. I'm doing this so that I can give all students a chance to participate equally.
Use a helper column. In that column put the following formula:
=IF(B1=0,"n/a",SUMPRODUCT(B1:E1/10^(COLUMN(B1:E1)-MIN(COLUMN(B1:E1)))))
This will return a single number based on the rankings.
Then in your output column use:
=IFERROR(INDEX(A:A,MATCH(LARGE(F:F,ROW(1:1)),F:F,0)),"")
Then a simple VLOOKUP to return the first number:
=IF(I1<>"",VLOOKUP(I1,A:B,2,FALSE),"")
Wondering if I could get help getting the correct formula to figure out the comm% based off the price it was sold at.
Basically, there are two spreadsheets.
First one is our price grid to show what the commission pct will be:
Product - 20% - 15% - 10%
Widget 1 - 3990 - 3490 - 3090
Widget 2 - 4990 - 4490 - 4090
Widget 3 - 5990 - 5490 - 5090
The second spreadsheet would list the Products sold and at what price it was sold at:
Widget 2 - $4690
Widget 3 - $5100
Widget 1 - $4000
I was thinking INDEX/MATCH. I can do the MATCH correctly to find the correct row, but I'm not sure how to incorporate that price range lookup into the formula.
In the example I gave above the commission should be 15%, 10% & 20% respectively.
Need to create a formula that matches the Product and then takes the price sold at and matches it to what column it would fall under and give me the % for that column.
I've spent weeks search the net and I can only get half way there. The MATCH to figure out which row the Product is on is simple, it's the price matching that's got me stumped.
Thanks.
You can solve this by making use of the rarely used Hlookup function, using it's range_lookup option. The only requirement for it is that you reorder your commission data from low% to high%. like this:
Product 10% 15% 20%
Widget 1 3090 3490 3990
Widget 2 4090 4490 4990
Widget 3 5090 5490 5990
If you've done this, you can use this formula to get the correct commission
=OFFSET(Sheet1!$A$1;0;MATCH(HLOOKUP(INT(SUBSTITUTE(B1; "$"; ""));INDIRECT("Sheet1!"&MATCH(A1;Sheet1!$A:$A ) & ":" & MATCH(A1;Sheet1!$A:$A ));1; TRUE);INDIRECT("Sheet1!"&MATCH(A1;Sheet1!$A:$A ) & ":" & MATCH(A1;Sheet1!$A:$A)) )-1)
This is the breakdown:
Format input as integer (commission data is int, values are $)
SUBSTITUTE(B1; "$"; "")
Use the input to put together the reference row for the Hlookup. We use indirect to add the sheetname and ":" to the reference.
INDIRECT("Sheet1!"&MATCH(A1;Sheet1!$A:$A ) & ":" & MATCH(A1;Sheet1!$A:$A ))
Use Hlookup to find the matching value:
HLOOKUP(INT(SUBSTITUTE(B1; "$"; ""));INDIRECT("Sheet1!"&MATCH(A1;Sheet1!$A:$A ) & ":" & MATCH(A1;Sheet1!$A:$A ));1; TRUE)
Use the found value in a horizontal match function to find the used column, and substract 1:
MATCH(<hlookup>; INDIRECT("Sheet1!"&MATCH(A1;Sheet1!$A:$A ) & ":" & MATCH(A1;Sheet1!$A:$A))) - 1
Use Offset to find the matching value
Offset(Sheet1!$A$1;0; <match>)
I have a teacher gradebook that uses category weighting (and evaluation weighting within each category). The formula I use to calculate final grade is found in column E here:
https://docs.google.com/spreadsheets/d/1TMsuJWtc4C7tebZGVVyeA4qbmLCnGZRi55ZRJsI-jGE/edit?usp=sharing
What I would like to do is give teachers an option to reduce the total marks for any particular student for an evaluation.
Example:
Evaluation total marks is 10, student mark is 4 (40%)
Teacher decides to make the total marks for this student = 5.
Teacher would enter: 4 [5] where 4 is the student mark and [5] is the new total marks for the evaluation. New percentage is 80%
I have written the formula to calculate the new percentage without issue however I cannot figure out how to get the final grade for this student.
In the linked spreadsheet above, student 1 and student 2 should have the same final grade in column E.
How can I change my formula in column E (starting at E8) to include cases like 4 [5]?
I believe the simplest solution would be to rewrite your formula in column E to use the numbers from the percentage column to calculate the grade, instead of using the complicated string you will find in the marks column.
Example formula that you could use in E8:
=IFERROR(SUMPRODUCT(FILTER(N8:Y8,ISFORMULA(N8:Y8))*FILTER(N$4:Y$4,ISNUMBER(N$4:Y$4))) *100 / SUM(N$4:Y$4),"")
Well that was fun! Using the recommendation of #TomSharpe I came up with this that seems to work:
=IF(ISBLANK($C8),"",IFERROR((
Settings!$E$3*(IF(COUNTIF($N$5:$HD$5,Settings!$D$3)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$3,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$3,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$4*(IF(COUNTIF($N$5:$HD$5,Settings!$D$4)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$4,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$4,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$5*(IF(COUNTIF($N$5:$HD$5,Settings!$D$5)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$5,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$5,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$6*(IF(COUNTIF($N$5:$HD$5,Settings!$D$6)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$6,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$6,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$7*(IF(COUNTIF($N$5:$HD$5,Settings!$D$7)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$7,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$7,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$8*(IF(COUNTIF($N$5:$HD$5,Settings!$D$8)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$8,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$8,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$9*(IF(COUNTIF($N$5:$HD$5,Settings!$D$9)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$9,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$9,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$10*(IF(COUNTIF($N$5:$HD$5,Settings!$D$10)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$10,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$10,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$11*(IF(COUNTIF($N$5:$HD$5,Settings!$D$11)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$11,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$11,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
+
Settings!$E$12*(IF(COUNTIF($N$5:$HD$5,Settings!$D$12)=0,0,SUMPRODUCT($O8:$HE8,$N$5:$HD$5=Settings!$D$12,$N$4:$HD$4)*100/SUMIFS($N$4:$HD$4,$N$5:$HD$5,Settings!$D$12,$O8:$HE8,">=0",$N$3:$HD$3,">=0")))
)/(IF(COUNTIFS($N$5:$HE$5,Settings!$D$3,N8:HE8,"<>")>=1,Settings!$E$3,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$4,N8:HE8,"<>")>=1,Settings!$E$4,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$5,N8:HE8,"<>")>=1,Settings!$E$5,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$6,N8:HE8,"<>")>=1,Settings!$E$6,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$7,N8:HE8,"<>")>=1,Settings!$E$7,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$8,N8:HE8,"<>")>=1,Settings!$E$8,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$9,N8:HE8,"<>")>=1,Settings!$E$9,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$10,N8:HE8,"<>")>=1,Settings!$E$10,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$11,N8:HE8,"<>")>=1,Settings!$E$11,0)+IF(COUNTIFS($N$5:$HE$5,Settings!$D$12,N8:HE8,"<>"
)>=1,Settings!$E$12,0)),"No Grade"))
Hoping someone can help,
I work for a fire department and i am trying to determine the number of times all our rigs on the road at emergencies at the same time. I have all the data from date, times, etc... So what i am looking for is an excel summation total that would display the sum of overlapping times that were greater than 3. So kinda as follows:
Rig Date Start Time End Time
1 1/1/2015 0703 0759
2 1/1/2015 0705 0823
3 1/1/2015 0706 0815
4 1/1/2015 0723 0759
1 1/1/2015 0802 0845
With more than three rigs on the road after 0723 it would grant me a total of one but then at 0802 rig 1 goes back out again meaning my total would increase by 2 and so on and so on. I dont have the slightest clue as to how to program this. I have three years of data i need to crunch through and something like this would help me greatly. Any help whatsoever is appreciated. Thanks in advance and lets see what you all come up with!
First, you might want to convert the times to Excel date-times (assuming you already applied Format as Table to your data, so all new formulas get populated for all rows automatically):
if the values are already Excel times, use:
=$B2 + C2
if you have integers like "703" (formatted as "0703"), use:
=$B2 + INT(C2/100)/24 + MOD(C2, 100)/24/60
or if you have values-as-text:
=$B2 + LEFT(C2, 2)/24 + RIGHT(C2, 2)/24/60
Don't forget to format the new columns using Custom Number format d.m. hh:ss or m/d hh:ss.
The next step is to count all ongoing deployments that end only after the current deployment started, i.e. use following formula as illustrated on screenshot:
=COUNTIFS(F$2:F2, ">" & E2)
Please make sure that the formula e.g. in row 13 looks like =COUNTIFS(F$2:F13, ">" & E13) to check that you are on the right track. Also none of the values can be 5 or more if you only have 4 rigs, otherwise you have an error in your data.
And to count number of times when all 4 rigs were in use, the formula looks like this:
=COUNTIFS($G$2:$G$13, 4)
In case you also want to sum the time while none rigs were available, add 2 more columns in your table. Column H in my illustration needs following array formula (entered by Ctrl+Shift+Enter):
=IF(G2=4, MIN(IF(F$2:F2 > E2, F$2:F2)), "")
And a normal formula in column I:
=IF(G2=4, H2-E2, "")
Don't forget to format numbers accordingly.
And do a simple sum: =SUM($I$2:$I$13).