Working in Google Sheets I'm making a gradebook. In the gradebook there are different assignment types that have different weights which can be chosen from the drop down. I would like to...
Average like assignment (there will be 3 values)
Weigh them appropriately (0.1 for baseline, 0.7 for Critical, 0.2 for accelerated.)
Add all the values together into 1 grade percentage.
Display them on grade report sheet for appropriate student.
I would like for this to be dynamic, so that if I change the assignment type (or any other values) the grade will change appropriately.
my MWE can be found here.
The AverageIf function will do what you need. So code like:
=averageif(B$3:G$3,"Baseline",B4:G4)
sitting next to your student in the 4th row (this is draggable, so row will update) that checks against values of assignment type in your 3rd row (3 is fixed by the dollar sign, so draggable) will accomplish your goal 1.
Once you do that for each of the averages, you can define one more column as =0.1*baseline avg+0.7*critical+0.2*accelerated
[not exactly that, I am pseudocoding] to achieve your other 3 objectives, I think.
Related
I have a Google Sheet with two tabs - one containing percentage "bands" values and the other with data in a table which includes rows for new entries and columns off to the right edge which store running totals depending on the entry type. The running totals depend on the row entry being of the same type and month period. This all works as expected.
I need to calculate a value in column I based on a row entry amount/cell (column H) which references the running total for that entry type AA:AF and month and then uses the relevant predefined percentage "bands" values (tab R1).
I had successfully got this working when a single entry would only ever cross one "band" level (the bands were previously tens of thousands apart) by using SWITCH and VLOOKUP functions.
The current formulas in column I use this method which no longer works since the percentage bands are now much closer together than they were before and a single entry could take the running total value for that entry over multiple bands (and not just the previous band, as before).
On the example sheet, cell H6 contains 9,900 as a test value since this increases the running total for that row AB6 to 16,313 from the prior running total for that type, 6,413 and spans 4 percentage bands:
Band A: 0-7,500 - 5%
Band B: 7,500-10,000 - 7.5%
Band C: 10,000-15,000 - 15%
Band D: 15,000 - 25,0000 - 17.5%
My original formula first checks the entry Type using a SWITCH, then matches the highest "band" value using a VLOOKUP and then an IF to check if the previous running total was less than the highest matched "band" value, calculating and adding the difference if needed.
I've tried to figure out how to calculate the same result when multiple bands are crossed (as in example) but I can't find a way to structure the formula so that it can apply universally down the column using the matched band rate(s), previous running total and new running total values.
Is there a mathematical way to do this or will this require multiple nested IF statements etc or would another approach work better?
I solved this by modifying the formulas on this page. Changing the layout of the bands was a good first move.
Now, column I calculates the value from the current running total (matched from type in column A) and subtracts the value calculated in the same way but using the previous running total to give the amount applicable to the newly entered value on the same row in column H. I've some more testing to do but fairly sure it works correctly. Any other ideas, feel free to suggest!
Provisionally working sheet here: https://docs.google.com/spreadsheets/d/1e2pdyOi7dz_ZA8zfNtsHxieEUb5fiZGpD_FwRvkHyYw/edit?usp=sharing
I have been trying to use an If(and... to grab a lookup if the weight (column F) meets the range on a second sheet between the min and max columns.
For example: If a SKU's weight is between a highsize and a low size on sheet 2 and the helper column matches, then I'd like to pull in the price.
Link: https://docs.google.com/spreadsheets/d/1ermKIQnZRcWzm8ogDE7IK0fQSLohDsOBHuaUjjRi8io/edit?usp=sharing
The helper column is a join of the shape, color, and clarity, however, the carat weight will then decide what the standard industry price for that goes.
Multiple SKUs can have the same shape, color, and clarity so the weight would be the defining factor. I created helper columns to help with that part, however, I am having trouble getting a formula that would combine a lookup and an if weight is >highsize and <lowsize.
The main project I'm working on has many, many, skus so going through each one and copying is not a viable solution. The second part is that the second sheet's prices will update on a weekly basis so I need to be able to update it to populate on the first sheet.
try in P1 cell:
={"E-Price"; INDEX(IFNA(VLOOKUP(B2:B, 'e-Price Ranges'!A2:G, 7, 0)))}
Is there a way to sort a Google Sheet by the order in which values are entered into a data validation criteria?
I want to sort the sheet based in ascending order Low,Medium,High or descending order High,Medium,Low. Not by alphabetical order High,Low,Medium and Medium,Low,High respectively.
Aaron. The easiest way would be to use a helper column (which you can hide later if you like) wherein you assign numerical values to your Low, Medium and High (presumably 1, 2 and 3 respectively). Then you sort using the numerical column. It's fairly easy to write a one-cell array formula that would assign the numerical values to your labels. The numerical column need not be beside the label column; it can be any column.
Without seeing an actual sample sheet, I can't show you. But hopefully the concept is clear, and you can take it from there.
Added description after sheet was shared:
In the example sheet, Sheet1 Column A contained the Priority in words (Low, Medium, High) and Column B contained "other data." I placed the following array formula into C1:
=ArrayFormula({"Priority Val";IF(A2:A="","",VLOOKUP(A2:A,Data!A:B,2,FALSE))})
The formula is an array formula, hence the ArrayFormula() wrap.
Inside this are curly brackets {} which allow the building of arrays that are not "of a type." In this case, the header is listed first ("Priority Val"). The semicolon means "place the next part underneath." Then a VLOOKUP references every value in Column A (i.e., the priority words) against a simple chart in a second sheet named "Data." In that "Data" sheet, Column A simply lists 1, 2, 3 and Column B lists your exact words: Low, Medium, High. The IF() function just checks to see if a row in Sheet1!A:A is blank. If so, a null is assigned before trying the VLOOKUP; otherwise, every blank row would show an #NA error.
If you want to make it even more air tight, it's good practice to wrap VLOOKUP in IFERROR(), just in case you misspell something in Sheet1!A:A. That would look like this:
=ArrayFormula({"Priority Val";IF(A2:A="","",IFERROR(VLOOKUP(A2:A,Data!A:B,2,FALSE)))})
And you can avoid misspelling by applying data validation to Sheet1!A2:A, referencing Data!A:A as the only allowable answers. This is not strictly necessary; but I have done it in the sample sheet to show you.
Have a sheet with items which have data attributes, and may be used for multiple purposes.
There is a lookup table to lookup a score, based on the attributes.
So I can get the score for each item, see the top right section, and then sum that for each of the purposes. So purpose 1 has 11 data attribute points etc.
The score formula is included in the image for reference.
However, rather than copy all the data and score it, ideally would like a formula that can just go into a scoring column. Otherwise, with say 200 items, I need to have 201 columns just to score this one thing...
However, sumifs and sumif won't do this. What I really want is a "sum(foreach cell in range, do this formula)"
Does anyone know how this might be done?
Just on this mini example, you could use
=ArrayFormula(sum(if(C4:E4="yes",vlookup(C$2:E$2,$B$9:$D$11,match(C$3:E$3,$C$8:$D$8,0)+1,false))))
so you do a lookup on attribute 2 to find which column to do the lookup on attribute 1.
Sorry about the imprecise title. Allow me to elaborate. I'm currently in the process of making 'Order' sheets for the small retailer i work for. Some items are easy to count due to low inventory while other items are abundant and difficult to count but easy to gauge whether we ought to order them.
When an employee takes a store count, the on-hand number they put down is contrasted with a minimum. The minimum is our lower threshold. The minimum is subtracted by the input quantity and a formula produces a third column, "Order". If the number in the order column is < 0 then a query function on a separate sheet will copy the entire row. To be clear, there are three columns, "On Hand", "Minimum", "Order", with the "Order" column containing the following mathematical formula:
="Minimum" - "On Hand"
[Cells are specified so that it would look more like "=B2-A2".]
However, I'd also like to include the ability for employees to put a simple 'x' in the count spot, signifying that we need to order the product without having to count every single instance of the item. I'd still like to include the ability for them to enter a number if they so choose. I'd like for them to be able either the number or the 'x' in the same column. I'm currently using the following query function:
=QUERY('String(Fail)'!A:D;"select * where A contains 'x' or C > 0")
[The above is from a sheet I'm experimenting with. I will provide a link below in case you're more hands-on.]
The issue arises when the formula in the "order" column outputs any sort of number. If the formula is functional, no row marked with an 'x' is copied to the new page via the query command. If any row produces a numeric, no 'x' rows are copied over at all. I've experimented a bit but am at a loss as to where to go next.
The sheet I'm currently experimenting with is linked below. If you'd like any additional information I'd be happy to provide it. I'm relatively new to all of this so excuse my stupidity. I do recognize that I could very likely make a script for this but am not well versed in scripting with Google Apps and enjoy the immediate benefits of the query function.
Any help is welcome. Thank you.
Experimental Spreadsheet
All the values in a column need to be of the same type in order to be evaluated by QUERY. The mix of 'x' and numbers is confusing things.
If you use the Format menu to ensure all the values in column A are Plain Text, then your Query will work. (Formatting a numeric value as plain text does not stop it from working in a numeric calculation, so your column C survives.) Here's a screenshot of your query, after doing that formatting:
Based on your specification, your query needs to have the comparison to zero reversed, like this:
=QUERY('String(Fail)'!A:D;"select * where A contains 'x' or C < 0")
^^^