function for creating a evaluation calculator using checkbox - google-sheets

I am trying to create a evaluation calculator that calculates points based on the criteria on google sheet using checkboxes. These are the criteria:
AC=30,UR=15,BILLING=15,ASSESS=15,ER=15,AP=10
if there's no assess and ER the UR and billing will automatically set to 30 but if there's no ER the assess, UR and billing will automatically set to 20.. but I cant get the desired output. the output should only be a total of 100.
been trying the IF Condition using this formula:
=IF($F$8=TRUE,30,"")+(IF($F$9=TRUE,30,"")-IF($F$11=TRUE,15,""))+(IF($F$10=TRUE,30,"")-IF($F$12=TRUE,15,""))+IF($F$11=TRUE,15,"")+IF($F$12=TRUE,15,"")+IF($F$13=TRUE,10,"")

Related

Advanced filter/configurator based on dataset

I would like help with a problem, or rather a challenge in Excel and/or Google Sheets.
What we want to develop is as follows:
We have a table of products and certain attributes. Now we want to create a kind of search function based on this table.
Example:
Let me give a simple example. Suppose you have as a product an apple, a banana and an orange. The characteristics associated with these are size, color country of origin. We then want a search function, where you indicate one or more preferences, i.e. size, color and/or country of origin and that based on those criteria, all products that meet these criteria are displayed.
So if you specify oblong as the size and do not specify any other criteria, it only shows "Banana. If the banana and the orange have Holland as their country of origin and you only give Holland as the criteria country of origin, it will show 'Banana' and 'Orange'. If you say country of origin Netherlands and format oblong, it again shows only 'Banana'
See below an image of our document and how we would like this to look approximately.
Currently, there is no existing formula, because we simply do not know if this can be done and how best to do it.
The document can be accessed at:
A copy of our document with sample data:
Document
ADDITION:
Hi, Unfortunately I still am not able to get it to work. I am not really a hero in coding/functions. I created a bit more of a clear view in my file and also set the language of my sample file to english. You can find it here: Sample
What I actually need is just that it shows the data on 'Datasheet' if conditions on the left (parameters/value) are met, but only if they are filled. Probably easy one for you, hard to me haha Could you help me out once more? –
Your question is very generic, I will try provide here some guidelines on how to achieve it in Excel or Google Sheet based on my own experience. The approach used for Excel can be used for Google Spreadsheet, since it is based on FILTER function that both tools have but with different signature. For Google Spreadsheet you can also use QUERY that is very powerful for situation like this.
In all cases, it is a good practice to have a sheet with the input raw data (let's say Input tab), then in second sheet the working data of filtered data (let's say WorkData). This is specially relevant when the raw data is big dataset, so you don't touch the original data set, and instead you have the filtered data in a separated tab.
Both tools offer filter features in the UI or slice. This is something to consider, but using Excel/Google Spreadsheet functions, you can show the filter parameters in a more friendly manner, because you can see the parameters selected without additional click to find what filter values where selected. The approach here is based on Excel/Google Spreadsheet functions.
Excel
Let's say you have a block of filter conditions that you want to apply to a range of data. You can use data validation list so you can select a subset of possible values for each of the filter conditions and then to concatenate such conditions logically (OR or AND) using multiplication of addition.
=FILTER(dataset, condition1 * condition2...conditionN)
where each condition is based on the filter value you want to restrict and each condition represents an array of {TRUE,FALSE} values all of them of the same size as dataset (number of rows).
I use some wildcard values to represent all values of the column, in my case I use ALL, but you can setup in a different way. In such case the filter doesn't take effect, but we want to make it work when a specific value is selected. The following trick can be used for both scenarios.
IF(B3="ALL", D3:D15<>"*",D3:D15=B3)
indicating that if B3 is equal to ALL, then the condition to select all of the D3:D15 rows is the following: <>"*". Otherwise select only the rows equals to B3.
Sometimes I would like to consider OR conditions for a given filter condition, for example for a given filter condition, consider value1 or value2 and it is represented in the filter value as a list of values delimited by comma, for example: value1, value2.
Here, some Stack Overflow questions I posted with answers about how to deal with that:
Filter an excel range based on multiple dynamic filter conditions
Filter an excel range based on multiple dynamic filter conditions (with column values delimited)
Google Spreadsheet
The FILTER function here, allows to add the filter conditions via input arguments, so now we have:
=FILTER(dataset, condition1, condition2...,conditionN)
Note: Keep in mind in Google Spreadsheet we don't need to add the conditions by multiplying each one of them. It is added via input argument.
here you can check some of question I posted related to this topic:
Using ARRAYFORMULA with SUMIF for multiple conditions combined with a wildcard to select all values for a given condition
Using ARRAYFORMULA with SUMIF for multiple conditions combined with conditions using a wildcard. Result by Months
In some cases it is better to use QUERY function.
Here, a sample file using QUERY statement and how to combine multiple conditions inserting IF in the where statement.
sample query on C1 cell:
=query('Jira Issues'!$A:$T, "where "
& IF(B2="", "G is not Null", "G >= date '"
& TEXT(startPeriod,"yyyy-mm-dd")&"'")
& IF(B3="", "", " and G <= date '"
& TEXT(endPeriod,"yyyy-mm-dd")&"'")
& IF(OR(B4="ALL",B4=""), "", " and A='"&B4&"'")
& IF(OR(B5="ALL",B5=""), "", " and I='"&B5&"'")
& " label A 'Team', S 'Reporter', T 'Assignee',
P 'Env.', I 'Release'",1)
The raw data is in Jira Issues tab, the data populated is based on multiple filter conditions. I am using some name ranges for the filter values for a better understanding of the formula, such as: startPeriod, endPeriod, etc. You can test the actual query will be invoked looking at the result of the consolidated string of the query input argument of QUERY function.
Similarly you can stablish a where statement to consider whether the input parameter is empty or not. In such case, you can build a logic like this inserting an IF block as part of the where statement and concatenate the string result.
=QUERY(Input!A:Y,
"select *" & " where A " & IF(B2="", "<>'*'", "='"&B2&"'")
"and " & " where B " & IF(B3="", "<>'*'", "='"&B3&"'")
,1)
The above query for column A or B, returns the entire column via condition: "<>'*'" if the input parameter B2 or B3 were not specified. In a similar way you can add additional conditions for more parameters, repeating the third line of the query and changing the column and the parameter cell.
Recommendations
Focus on a specific tool: Excel or Google Spreadsheet, even they have some similarities, you need to get familiar with the specifics of each one of them.
Try to start working on your specific problem, once you face impediments, do some research, usually you are not the first person facing this problem, if you don't find a solution, then post your specific problem using a sample as an extract of your real problem (in English, your sample is in other language). Generic questions like this one are difficult to get some attention.

How to generate a distribution based bar chart on row_numbers

I have a SQL query that acts as a data source in my tableau desktop:
SELECT
row_number() over (order by sales) as rn,
article_number,
country,
SUM(sold_items) as si,
SUM(sales) as sales
FROM data.sales
WHERE sales.order_date between '2021-01-01' and '2021-12-31'
GROUP BY 2, 3
On tableau I dragged rn to column and sales to row to generate a bar chart. The following is the output:
I want to convert this into a 0-100% distribution chart so that I can get the following result:
How can I achieve this? Also, I want the user to filter by country level so even if the # of records increase or decrease, the distribution should always be consistent with the filtered data.
You can do this with nested table calcs.
For example, the following uses the Superstore sample data set, and then first computes a running total of SUM(Sales) per day, then converts that to a percent of total. Notice the edit table calc dialog box - applying two back to back calculations in this case.
The x-axis in this example is Order-Date, and in your question, the the x-axis is a percentage somehow - so its not exactly what you requested but still shows that table calcs are an easy way to do these types of operations.
Also, realize you can just connect to the sales table directly, the custom sql isn’t adding any value, and in fact can defeat query optimizations that Tableau normally makes.
The tableau help docs explains table calculations. Pay attention to the discussion on partitioning and addressing.

How to create column and lines charts from this simple spreadsheet?

I'm trying to create two charts from a local cycling club's account spreadsheet. These will provide "at-a-glance" overviews of the state of the current finances.
The spreadsheet has a columns with incoming monies (receipts) and the date received, with similar columns for outgoing money (payments).
The first chart will sum up the incoming outgoing columns and display these in a simple column chart. A quick glance should show that the incoming column is taller than the outgoing (hopefully!). This is where I hit my first problem - I don't seem to be able to use SUM in the chart:
I have ended up having to reference a cell containing the sum of the column, but this sum takes into account a cell (C3) which contains balance brought forward from a previous year which I want to ignore for this chart:
The other chart I want is a line chart showing amount of money on the y-axis and time on the x-axis. The receipts line should go up over the year (again, hopefully) and the payments should go down. I'm not even close to getting this correct:
It should be something like this, so as the year passes (x-axis) the amount (y-axis) of receipts and payments increases:
How can I create these charts?
Spreadsheet is here - https://docs.google.com/spreadsheets/d/1-8DzB6c3rZ8evfNJ8iRcO_2BletbH81FV4hIis0-Fj4/edit?usp=sharing
I tried to replicate your graph and found some issues:
On the first graph, you cannot use formula in Data Range. The input should only be a A1 notation. Creating another entry on B16:C17 and use it as graph data is correct.
If you want to ignore C3, just change the formula in your C16 with =SUM(C4:C8)
Based on the sketch you've provided for the second graph, The data will only go up by getting running total or cumulative sum of each data per category (Receipts, Payments). Unfortunately, Google Sheet does not have built it function that can automatically do that. You have to create another column for cumulative sum.
Example:
For Receipts, insert this in D4:
=ArrayFormula(If(len(C4:C8),(SUMIF(ROW(C4:C8),"<="&ROW(C4:C8),C4:C8)),))
It will create another column with cumulative sum of C4:C8.
For Payments, insert this in H3:
=ArrayFormula(If(len(G3:G7),(SUMIF(ROW(G3:G7),"<="&ROW(G3:G7),G3:G7)),))
The dates from Receipts and Payments are different, if you only use the dates of Receipt, the data for Payments will be inaccurate. You need to create another table that will combine the dates and data of those two categories.
Try this:
J2: ={A4:A8;E3:E8}
K2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, A4:D8, 4, false)))
L2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, E3:H7, 4, false)))
Make sure to add Labels on K1 and L1.
It should look like this:
Once you have the data, just highlight J1:L11 and Go to Insert -> Chart -> Convert it to Smooth line chart -> Check Aggregate
The graph should look like this:
References:
VLOOKUP
ARRAYFORMULA

Google Sheets: Add value to total if a row condition matches for infinite column

I am attempting to make a Google Sheet that has a column for a rate and a value of that rate. Each night I am adding a new value to the bottom of this list so I want it to continue as an infinite list. What this sheet should do is look down the list of rates, if the rate matches a predefined rate, it should add the corresponding value to the total for that rate. I have four common rates that occur in no particular order and with some given value. I would like to total the values for each of those rates and give them in the totals section so each rate can be easily referenced.
Is there a way to do this using Google Sheets built-in commands? Pseudocode would be something like IF(A2:A = rate, add value in B to total). I know to make an infinite reading of a column by A2:A, but I don't know how to check each value as it goes through that column. I have attached a test spreadsheet with some sample values and the output that should be given by the formula. Thank you in advance for your help.
https://docs.google.com/spreadsheets/d/19k1DMipSsI9tWSjTXrVAPzPoaenWS6WYmlwe201_WQk/edit?usp=sharing
I managed to discover my own answer using the SUMIF statement. My code for the rate of .75 is ""=SUMIF(A2:A,"=.75",B2:B)"". I ran into some more trouble with the section for a different rate because I was having trouble saying not equal to .75 or 1 or 1.5 or 1.75. I solved this problem by completely bypassing it and adding the all the values and subtracting away the values already added. I would still like to know how to give the list of "ors" if someone could shed some light on this. But I now have a working solution regardless. I have updated the test sheet to show the solution.

Google Spreadsheet: Summing up a range by using numeric value in another cell

I'm an AP Biology student and am trying to create a mathematical model for a Hardy-Weinberg lab using Google Spreadsheet. Here is the link to the spreadsheet. The problem is located on the "Gene Flow" tab on N111.
So I am trying to add all the number values above N until it hits a certain number. That quantity of organisms is dependent on the total number of organisms AFTER the migration of Generation 1. And that migration is just random chance of whether some will leave or arrive. By adding up the new generation, I need to calculate the genotypes of their offspring (a.k.a. Generation 2), assuming there is 1:1 ratio between each generation.
Here is the code I tried:
=SUM(N6:N(SUM(F107:H107)+6))
However, the error I receive is Argument must be an range.
Is there a way to properly express this through Google Spreadsheet?
You could use the INDIRECT function. It returns a cell/range reference with only a string as input. For example:
=SUM(INDIRECT("N6:N"&(SUM(F107:H107)+6)))

Resources