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.
Related
I have a column of values that are a number out of 10. So, it could be 2/10, 3/10, 4/10 and so on, all the way up to 10/10. To be clear, these are not dates, but simply showing how many questions the student answered correctly out of 10.
I'm trying to use conditional formatting to highlight them a certain color depending upon the score they got. For 9/10 and 10/10, I'm wanting to use a certain color, but it doesn't seem to be working with REGEXMATCH or with OR. Also wanting to highlight all scores that are 6/10 or lower. I know that I could make this work by applying conditional formatting for each and every score with text contains but the problem I'm finding is that it thinks it's a date.
Is there a way to match multiple scores out of 10 using REGEXMATCH?
Link to Sheet
select column and change formatting to Plain text
now you can use formula like:
=REGEXMATCH(A1; "^9|10\/")
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
This is my first post on here, so please excuse any mistakes.
I have a column of cells. Each cell contains a variable number of lines withing the cell. Most lines contain a date. The format of the date varies slightly. Sometimes it is in the format MM/DD/YYYY, sometimes it will be MM/DD/YY, etc. My goal is to extract the date associated with a specific word in each line. Also, each cell is on a row with an identifying number. Therefore, I need the output to be along the same row.
Example:
I have tried every extract date formula I can find and I have run into three problems:
how to pull multiple dates from the cell,
how to compensate for the fact that some rows have dates that are formatted differently, and
how to pull dates only associated with certain words on the same line as the date.
It appears that my best option would be to use Regular Expressions. However, I have just started playing around with VBA and every function I have found that seems related to my issue I have been unable to adapt to my specific problem. I was using this post as a guide to build my function initially, but I cannot get it to work: Extracting Multiple Dates from a single cell
Originally, I tried breaking the lines up by doing text to column and this formula:
=IF(SEARCH("Red",D2),DATE(MID(D2,SEARCH("??/??/20??",D2)+6,4),MID(D2,SEARCH("??/??/20??",D2),2),MID(D2,SEARCH("??/??/20??",D2)+3,2)), "No Red Date")
However, text to column was not working because of irregular spacing issues. And Blue 1 and Blue 2 is just there to compensate for if there are multiple Blue dates in the cell, which there often are
NOT AN ANSWER : It doesn't really need code, you can use MID FIND SUBSTITUTE quickly playing, I used the following
=IF(FIND(C$1,$B2,1)-11<11,MID($B2,1,10),MID($B2,FIND(C$1,$B2,1)-11,10))
Which gives this,
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I want to read orders from order.txt which is;
Chocolate Chip Cookies 1 2
Orange Jelly Candy 2 7
Chocolate ice cream 3 11
Cake Mix Cookies 1 10
And decide if there is enough product from stock.txt which is;
Name Type ItemCount Price
Chocolate Chip Cookies 1 4 600
Orange Jelly Candy 2 5 150
Cake Mix Cookies 1 12 180
Peanut Butter Chocolate Chip Cookies 1 3 120
Chocolate ice cream 3 2 240
Gummi bears 2 15 300
Raspberry Ripple 3 12 250
Alignment is given like that. What is the best way to do it? Is there anything to read from a file which I can store in a way like product name/ number/ price?
Thank you.
I don't understand what the second and third column signify, I assume one of them is order size.
There are many ways to do this and my method might not be the best in all cases but at least it should work in yours:
Read the stock.txt file, you can look at this example but it doesn't really matter what method you use. The important thing is to get the information as a variable into the program. Hopefully your text files uses a tab to separate the fields (this information is lost in the question).
Put the information you get into a std::map, call it orders, use the name as key and the ItemCount as value.
Now read the information in order.txt, use the key to look up the value in your orders.
Check that ItemCount is at least a large as the order size.
In a real world application you would use a Database to store the data of your stock and would write a class order which gets its values from the databas. However i dont think you want to have that much effort so here's a esier way:
Your stock data gets saved in a simple excel table and the order is a textfile
Order.txt:
Beer 1|Paint 5|Oil 3|.....
Use the | as markers to create substrings of the individual products in the order
Bsp. ProductName quantity id|ProductName2 quantity id2|....
As for the excel table you have to to a little research yourself but editing files with a filereader isn't that hard though.
Hope i can help
I am currently working with a large data set using R. So, I have a column called "Offers". This column contains text describing 'promotions' that companies offer on their products. I am trying to extract numeric values from these. While, for most cases, I am able to do so well using a combination of regex and functions in R packages, I am unable to deal with a couple of specific cases of text shown below. I would really appreciate any help on these.
"Buying this ensures Savings of $50. Online Credit worth 35$ is also available. So buy soon!"
1a. I want to get both the numeric values out but in 2 different columns. How
do I go about that?
1b. For another problem that I have to solve, I only need to take the value associated with the credit. It is always the case that for texts like above, the second numeric value in the text, if it exists, is the one associated with the credit.
"Get 50% off on your 3 night stay along with 25 credits, offer available on 3 December 2016"
(How should I only take the value associated with credits?)
Note: Efficiency would be important as well because I am dealing with about 14 million rows.
I have tried looking online for a solution but have not found anything very satisfactory.
I am not 100% sure about what you want but this may help you.
A <- "do 50% and whatever 23"
B <- gregexpr("\\d+",A)[[1]]
firstNum <- substr(A,B[1],B[1]+attr(B,"match.length")[1]-1)
secondNum <- substr(A,B[2],B[2]+attr(B,"match.length")[2]-1)
Hope this helps.
I have a sheet that has become complex, it has a lot of filters and I need to populate a table with data. I am counting how many times a month we run a product. If we run it once a day, or more, I want to only count that as one.
Date Product Grizzly
1/1 2.5 open
1/1 1.5 closed
1/1 2.5 closed
1/1 2.5 open
Something a little more elaborate than this, but what I need is to count this as one day of 2.5 grizzly closed, instead of two.
Any help? I feel like there is something simple I am missing but cant put my thumb on it and I have spent well over 15 hours working on this.
As found on the following link:
Link to Answer
Try using the DCOUNTA function within Excel.
Although I'm also sure that you could use a pivot chart to provide the same outcome.
EDIT:
I am assuming you are starting with data like the following:
I then created the following table which you can extend to comply with you total data value. For example, you can add extra dates and products.:
The table is populated using a COUNTIFS function.
=COUNTIFS("DateRange",DateCriteria, "ProductRange", ProductCriteria, "GrizzlyRange", GrizzlyCriteria)
So in my table the formula looks like this but the cell references will obviously changes according to your spreadsheet (I used absolute references to make it easier to use the fill handle to copy the formula down:
=COUNTIFS($A:$A,$E4,$B:$B,$F$3,$C:$C,$F$2)
I next nestled this formula in to an IF statement and applied a conditional formatting to end up with the following:
So the formula for each of the cells is now:
=IF("OriginalFormula),"Yes","No")
Example of my 01/01/2015, 1.5 open value:
=IF(COUNTIFS($A:$A,$E4,$B:$B,$F$3,$C:$C,$F$2),"Yes","No")
BUT - You can change the "Yes" and "No" to "1" and "0" if you want to stick with numerical values.