I have created a column of checkboxes and underneath I have a total box, where if a box is checked I want to add 8 to the total box, I have tried a few ways but am at a loss. My Current formula is as follow:
=QUERY(K3:K9,"where K = 0",1+8)
This, however, is only returning the True or false option. when all I'm trying to do is make it return a +8
Example
2 boxes checked that cell shows 16
5 boxes checked that cell shows 40
You can see what I am working on at this link and feel free to help with anything you want I do have it backed up and am struggling a lot with this. I will return at 2 am EST
My Sheet
try:
=ARRAYFORMULA(SUM(IF(K3:K9=TRUE, 8, 0)))
or:
=COUNTIF(K3:K9, TRUE)*8
Related
I'm trying to have information about the completeness in some survey results exported in to a Excel Format. I'm using Google Sheets, as every survey there is questions and subquestions the subquestions have a conditional, Example: 4. How are you today? multiple choice answers: Good, Bad, Prefer not to say, so there we have 3 answer options if we click good there is a conditional and the subquestion will be: Why?.
So in my survey there is 8 questions and question 4, 7 and 8 has conditional questions if someone answer "Yes".
Now here is my problem: to calculate the percentage of completeness I used this relation --> number of inputs in the survey/number of expected answers.
But as I mentioned before the conditional affects this expected answers this Variable is dynamic depending on the answers from question 4, 7 and 8. So I would like to obtain this Variable for every case, if someone put information will have an ID if we have 20 persons doing the survey we will have 20 ID's.
So for every record of answers the number will change depending on the inputs from Question 4, 7 and 8. I have prepared a document in Google sheets will the full approach that I tried but is still hard to have it right I would like to have some help with this.
I would like to use this kind of formula:
=COUNTIF(AI2:AR2,"Yes")>0
This tell me if in the range of the Question 4 there is a "Yes" to activate the subquestions.
Then : `IF(TRUE, 11, 1) Which should be the count if in Q4 there is a Yes at least for that row. That's a little simpler but is the approach I would like to do.
This is the points:
if any of these parts are filled with YES or NO that's 1 point for whole Q4(Correct)
every part of SUBquestion count as 1 (Correct)
if SUBquestion is filled does MAINquestion count as the sum of MAIN QUESTION and number of SubQuestions. Case of Q4: Answer was Yes, the count will be 11 the 10 parts plus the Main one. If Answer was No the count will be 1.
Link to Spreadsheet
In the file you will find more information.
Please some help with this I'm having days trying to solve it
Here is an image about it:
If I understood your question correctly this is the approach you want.
Try the following:
For Q4: =IF(COUNTIF('Original Data Base'!AI2:AR2,"Yes")>0,11,1)
For Q7: =IF(COUNTIF('Original Data Base'!BF2,"Yes")>0,2,1)
For Q8: =IF(COUNTIF('Original Data Base'!BI2:BR2,"Yes")>0,11,1)
Drag down to rows below.
Then to get the percentage of completeness use:
=(SUM('Anwers formula'!B2:AD2)/SUM(C2:J2))*100
To explain this syntax -> This gets the (Answer count / Number of expected answers) X 100 to get the percentage.
Result:
This returns the same result as you have in your sample sheet "Last Step".
Or all together in one formula:
=(SUM('Anwers formula'!B2:AD2)/SUM(5+(IF(COUNTIF('Original Data Base'!AI2:AR2,"Yes")>0,11,1))+(IF(COUNTIF('Original Data Base'!BF2,"Yes")>0,2,1))+(IF(COUNTIF('Original Data Base'!BI2:BR2,"Yes")>0,11,1)))*100)
You can remove the * 100 and format it to percent value.
Let me know if this resolves your concern, or if you need help adjusting this to your spreadsheet.
I have tried "If, and, or" combining with simple script, and I am really new at the Apps script in Google Sheets.
What I need is: if any condition is true, I want the formula/function to subtract the corresponding value only for that condition from a total.
Background: a client is expected to serve 2-3 hours a day M-F (it can vary). If M=3, T=2, W=1, TH = 3, Fri = 3, then weekly total hours (WorkHours) = 12.
But the client may not always be scheduled on any day and these nonscheduled days can vary by client location. When this occurs, I need to reduce WorkHours by the number of hours for a nonscheduled day.
For Example:
When Cell C4 = Monday and Cell C6 = x are true, that equals a nonscheduled day on Monday then the formula would only subtract Monday hours from WorkHours total = 9. But there can be multiple days, M, W and F. This can vary.
I tried the first half of this formula:
=IF(OR(AND(C4="Monday",C6="x"),AND(D4="Tuesday",D6="x"),AND(E4="Wednesday",E6="x"),AND(F4="Thursday",F6="x"),AND(G4="Friday",G6="x"))
But I can’t get the “then” half of this if-statement to work in a formula.
I tried combining it with Apps Script and I can share that, but it’s nothing to be proud of.
Thank you so much
Marby
Taking a wild guess from your data, try a SUMIFS or SUMIFformula
=SUMIFS(A4:E4,A6:E6,"")
OR
=SUMIFS(A4:E4,A6:E6,"<>x")
OR
=SUMIF(A6:E6,"",A4:E4)
(If still in need do share a test sheet or more info)
perhaps the solution to your problem is simpler than it looks, and there is no need to use scripts to make this calculation.
try to do the following way
A
B
C
1
DayWeek
isValid
TimeWorked
2
M
X
3
3
T
X
2
4
W
X
1
5
TH
3
6
F
X
3
FORMULA TO CALCULATE
=SUMIF(B2:B6;"X";C2:C6) // result 9 as example
if your spreadsheet is fed sequentially, or has multiple collaborators, I suggest you use the rows as columns.
A
B
C
D
E
F
G
H
I
J
K
1
M
3
T
2
W
1
TH
x
F
3
FORMULA
FORMULA
=sum(sumif(B1;">0";B1);sumif(D1;">0";D1); sumif(F1;">0";F1); sumif(H1;">0";H1);sumif(J1;">0";J1))
if you are sure that you will not have other numbers in the columns, the formula can be reduced to
=sum(SUMIF(A1:J1;">0";A1:J1))
Initially, none of your answers would have helped with the sheets as I had structured them. But your answers sparked a restructuring of my sheets. It made them simpler and more useful to my users.
I really appreciate all your help. It helped me improve my product. Now that my sheets have been adapted, the formula I used =SUMIFS(A4:E4,A6:E6,"<>x") - working beautifully.
I have to really thank you - you helped me improve my whole approach.
This is great, really really helpful
Marby
I am very new to coding and am trying to make a camera check out/check-in system using a google form and google sheet. I am using a bar code scanner to scan in the camera on the google form which is linked then to the google sheet. Right now I am trying to get the sheet to count how many times the bar code was scanned in and then based on that tell me if the camera is checked in or out. So if the bar code is scanned in only once I now someone checked it out but if it is scanned twice I know it has been returned and then when it appears a third time it is checked out again and so on and so forth.
I have already tried using LOOKUP but it only searches one row and I want to be able to check in several items at once. I also tried using VLOOKUP but it doesn't work either.
This is the code that I have so far but it only works once since it only looks if a code has been scanned in once or several times
=If(COUNTIF(Data_Entered!$E$2:$I$6,A2) = 0, "Check In", "Check Out")
I want it that instead of only saying = 0 that I can say = even numbers.
You can use MOD. Ex.) =MOD(A1,2)
It will return a 1 if odd, 0 if even.
=IF(ISODD(COUNTIF(A2:A, "<>")), "online", "ofline")
=ARRAYFORMULA(IF(LEN(A2:A), IF(ISODD(IF(A2:A<>"", ROW(A1:A), )), "on", "off"), ))
Ok, I just added a new feature to my student manager program (a console program written in c++) , it is a console application and my program print dates on which particular student is absent in a list format
by saying list format i mean 1 date on 1 line
this is how output looks like for student who is absent 5 times
1. 04/05/2016,Monday
2. 05/05/2016/Tuesday
3. 06/05/2016/Wednesday
(Assume dates are correct)
now since these are only 3 records that are printed on the screen, a user would not require scrolling down,
but in a case of 300 dates , it prints all dates but when i scroll up I'm not able to reach back to 1st date, for example, I'm only able to see last 147 Records only
and I'm not able to scroll my console window to 1st record.
I know many other ways to solve this problem (like displaying 10 records or 100 records at a time) but I want to know how can i solve this particular problem
please give answer considering me as a beginner. :)
Thank You.
(as far as code is concerned, i can assure you its nothing special, just a while loop that keeps on printing dates until certain terminating condition is met )
I think it is going to be harder to explain this than to get a solution. I am using sitescope to monitor a webpage. I need to check the webpage for the string Div Class='proxy'. We are using a software that automatically checks a group of computers. It then creates a dashboard with Each computer and its status. We always have 5 computers in this group. We want an alarm that goes off when a computer disappears. The sitescope monitor uses regex to search for content on the page. There is no other identify marks we can search for except for div class='proxy' which is created for each computer. Of course in the source code the 5 div classes are not sequential so (div class='proxy'){5} does not return a happy resonpse.
what we want.
If div class='proxy' appears 5 times in the document return true
if div class='proxy' less than 5 times in the document return false
Like I said the hard part was going to be explaning the issue.
Have you tried something like: (div class='proxy'.?){5}?