Conditional formatting based on multiple criteria - google-sheets

I don't know if what I wrote in the title is specific enough to what I'm looking for, anyway, I'll try and explain as much as possible here.
I have two sheets, one is the layout, the other is the database.
The layout is a layout of computers in an office, and in the database I have various information about those computers (e.g. manufacturer, processor, etc).
What I'm looking for is a way to change the colors of the cells in the layout sheet based on the data in the 'db' sheet.
This is the first sheet, where numbers are the ID's of the computers.
On the second sheet, I have more information about each number.
This is from the second sheet, the 'db' sheet.
What I'm trying to do here is change the colors of the cells in the first sheet based on information on the second sheet and based on the dropdown selected.
For example, in the pictures above, I have chosen 'computer' which needs to change the color of the cells based on the manufacturer given in the second sheet.
I would've posted a formula that I'm currently working on, but the problem is I'm very new to conditional formatting and currently am completely stumped on this problem.
Thanks in advance.

This might not be exactly what you're looking for but it's on the right path. I'm not sure if "Dell" and "HP" are supposed to be dynamic results of the data validation or? Either way...
=AND(VLOOKUP(C2:C,INDIRECT("Sheet2!A2:B"),1)=C2:C,VLOOKUP(C2:C,INDIRECT("Sheet2!A2:B"),2)="Dell",$D$3="computer")
and
=AND(VLOOKUP(C2:C,INDIRECT("Sheet2!A2:B"),1)=C2:C,VLOOKUP(C2:C,INDIRECT("Sheet2!A2:B"),2)="HP",$D$3="computer")
Be sure to reference C:K in the Conditional Formatting Rules. That way you can avoid having to repeat the process for each column.

Related

Transform comma separated google form answers to multiple lines in spreadsheet

I have made a google form to which some answers are formatted as comma separated strings inside the automatically populated google spreadsheet. I would like to read from this sheet to another sheet and reformat the answers so that each comma separated answer is shown on a new row. I have tried to apply an ARRAYFORMULA that reads from the original sheet and then use a solution that uses SPLIT and TRANSPOSE the cell content, however combined with the ARRAYFORMULA this fails since it would overwrite contents in other cells.
Here is an example spreadsheet with the responses, a solution sheet, and a desired results sheet. https://docs.google.com/spreadsheets/d/1r_l5fVJ9lGfpubO2o3pXicV7JlZWmANjwSgNi7_DL0A
Any suggestions for how I can achieve the end result?
Okay, I assume this isn't really what you want, but visually it looks okay...
Try this formula:
={{'Form responses'!A2:A3},ArrayFormula(regexreplace('Form responses'!B2:E3,", ",CHAR(10)))}
Then format the cells so that the cell contents are TOP-aligned, instead of the default BOTTOM-aligned.
Realistically, I imagine that you want each question answer split into multiple cells. But if your data responses really contain letter values separated by commas, as you've indicated, you can still search through those cells to find whether an answer contains a certain value. It all depends on why you want the results structured the way you do.
If you can clarify what you want to do with the form results, instead of just appearing vertically for each question, perhaps we can provide a full solution for that requirement?
UPDATE1:
Okay, I may be getting close. I can get your data transformed to look like the following:
This would let you do the analysis that you want, by searching for Q.1 (question 1 responses) in the first column, and then all the answers in the third column, along with the owner in column 2. And from this, it will also definitely be possible to put the results in the exact form you want. It just may take an intermediate step.
UPDATE2:
Okay, I think I have something you can use. I can convert your data to either of the following two layouts.
The one on the right is closest to what you asked for, with the exception that the answers on the right are bottom aligned, with blanks above. But you can still process them for analysis, with queries. I honestly think having the user identifier (email address) on each row would make things simpler, but I can provide it either way.
The layout on the left is more of a traditional database layout, and would make analysis very simple. Each row has the date and email identifiers, the question number, and the answer (or one of the answers) to that question, from that user.
If this is helpful, it might be best if you enabled your sample sheet to allow us to edit it, to enable me to implement it in your sheet. But here is my sample sheet, in case anyone wants to look through it. Note that the main formula to reformat the data, in Solution!B3, could benefit from a lot of cleanup, and is probably nowhere near the best way to achieve this. Just throwing up one possible solution...
I'll try to add some explantion for the formula at some point, but ask if you have any questions.

Google Sheet function to Split the Data Accordingly

I have a worksheet being fed by a Google Form. I want the responses on the Google Form to populate two fields in the next tab. The B column in the second tab is the one beyond my skillset. I have written out how the field should display, based on the form responses for reference. I also have used comments on the sheet to explain the rules for each field.
I know split function can be used but it wont adjust it. any possible solution.
Here the Sheet link
https://docs.google.com/spreadsheets/d/1ueKCNdcn1xmJHYtrzKKKkj_FSraRfpvJS4Oi3BHNUvk/edit?usp=sharing
I've added an answer on your sheet. Since the data is all delineated by semi-colons, this formula seems to match what you want.
=SPLIT('Import Data'!B1,";",0,0)
Let us know if it doesn't do what you want, or if this helps.
Updated: After checking with you, I realise that you want only some of the data split, and some kept concatenated. But since all of the data "fields" look the same, separated by semi-colons, and since there could be various numbers of fields in each response category, I don't think there is a simple logic that can tell where to split, and where to keep things like dress styles or sizes concatenated. So I understand that this is not your desired answer.

Creating Dynamic Sheet Cell Reference List for pulling numbers to SUM

I've been working on building a data analysis sheet, which is quite verbose at the moment and a bit more complicated than it should be as I've been trying to figure this out. Please note, I work doing student data in a school.
Basically, I have two sets of input data:
Data imported from a CSV file that includes test data and codes for Common Core Standards and the questions tied to those standards as a whole class summary
Data imported from a CSV file that includes individual scores by question
I am looking to construct 2 views:
A view that collates and displays data of individual standards per student that includes a dropdown to change the standard allowing a teacher to see class performance by standard in a broad view. The drop-down is populated dynamically from the input data (so staff could eventually dump data and go directly to reports)
A view that collates and displays data of individual students broken down by performance on each standard allowing a teachers to see the broader spectrum for each student. The student drop-down is populated from Source list 2.
I have been able to build the first view, but am struggling with the second. I've been able to separate the question codes and develop strings of cell references to the scoring data, including a dynamic reference to the row the selected student's score data appears on in the second source set from above.
I tried to pass through an indirect() formula into a sum() so as to process for a mean evaluation, and have encountered errors. I think SUM() doesn't process comma-separated cell reference lists from Indirect() [or in general] or there is something that I am missing to help parse it. Here is the formula I have tried:
=Sum(vlookup(D7,CCCodeManip!$A:$C,3,false))
CCCodeManip!C:C includes the created text (based on the dynamic standards and question codes, etc), here's an example of what would be found there:
'M-ADI'!M17, 'M-ADI'!N17, 'M-ADI'!O17, 'M-ADI'!P17, 'M-ADI'!Q17, 'M-ADI'!R17, 'M-ADI'!J17
I need these to be dynamic so that teachers can input different sets of standards, question, and student data and the sheet automatically collates and reports it in uniform ways (with an upward bound of 20 standards as I currently have it built)
Here is a link to the sheet I built, with names and ID anonymized. There's a CRAP TON of sub-tabs, and that's really just being able to split apart and re-combine data neatly without things error-ing out due to data overlapping, aside from a few different attempts and different approaches to parse the cell reference strings.
The first two tabs are the current status of the data views. I plan to hide a bunch of the functional stuff that is there to help pull data accurately.
The 3rd and 4th tab are the source data sets. 5th is a modified version of source data that allows me to reference things better, and I've tried to arrange the sheets most relevant towards the front of the set.
https://docs.google.com/spreadsheets/d/1fR_2n60lenxkvjZSzp2VDGyTUO6l-3wzwaV4P-IQ_5Y/edit?usp=sharing
Some have a different approach? I am aware that I might be as far as I cn go with this and perhaps should consider scripts - my coding experience is a bit out of date and my strength is more with the formulas, but I can dig into things with some direction, if anyone can help.
Ok so I noticed something.
It seems the failure is in the indirect reference:
=indirect(CCCodeManip!C3)
The string I am trying to parse via indirect is going to be generated into something like this, dynamic from reference to other data:
'M-ADI'!M17, 'M-ADI'!N17, 'M-ADI'!O17, 'M-ADI'!P17, 'M-ADI'!Q17, 'M-ADI'!R17, 'M-ADI'!J17
The indirect returns the error that the above string is not a cell reference with the #REF code.
Can someone give me a clue as to what is causing this? I am going to dig into the docs on Indirect() from google and will post anything that I find.
Perhaps it is that indirect() can't handle lists, but only specific references and arrays, which may require me a to build a sheet to do the SUM formula on for each question set (?)
So I think I figured it out, but i Ended up parsing the data differently, basically doing the sum based on individual cell references and a separate sum formula, bypassing the need to do it all at once, it jsut makes my sheets a lot dirtier! I am eventually going to see if code could do it better if I need to, but this is closed for now.
Basically, I did individual cell references to recall scores in a row, then used a separate SUM formula, and created references / structures to be able to pull those sum() results. Achieves the same end, but with extra crap on the sheet.

Importrange but only include certain values

I would like to create a new sheet from Google Form data which only imports cell data that matches specific criteria. Respondents have five response options for a number of questions (all questions have the same five options). I want the new sheet to only show the data in the cells that fit my criteria and the cells that don't, should be blank. I would like all rows and column formatting to remain the same.
I've got the import range part down, but I don't know should I use query, filter, if, or some other function?
Within the same spreadsheet, QUERY works well. You could also use QUERY(IMPORTRANGE( or just IMPORTRANGE if you want it to go to a different spreadsheet.
As Rubén said, if you want to maintain all the formatting, without manually doing it yourself on the destination sheet, you'll need to use script.
Query Reference
EDIT
See Sheet3 HERE. Make a copy to edit.
Any cell with a blue background has a formula. The main one is below.
=ARRAYFORMULA(IF('Form Responses 1'!D3:DD="","",SWITCH('Form Responses 1'!D3:DD,$D$1,"",$E$1,"",'Form Responses 1'!D3:DD)))
You will not be able to edit those columns. If you need to edit (like the "Comments/Adaptations" columns, you could modify the formula above and apply it column by column.
If that works, please click the green check mark to accept the answer!
Beside the number format, any formula keeps the format of the source range, so if your the format includes fonts styles, bold, italics, colors, etc., instead of a formula you should use a script.

How to combine dynamic ranges with OFFSET and INDIRECT functions?

I'm trying to create a formula that uses a dynamic range to link to the different tabs. It would then return the last 12 values before a blank cell, based on the value in the Header Column.
The tricky part is the data in each tab is of different sizes, so I thought it might have to incorporate either Offset(Blank()),0,-12) or something of the sort. I've tried a lot of different things, and this is the latest effort:
=Index(Indirect(A2&"!A9:AK9"),match("Conversions",Indirect(A2&"!A9:AK9"),)0,-12)
Edit: First post, sorry for the confusion. My goal is to make a large dashboard that has a dynamic chart using our monthly metrics. (I'm leaving the chart setup for another day)
The data varies in such, some have columns A:K, while some have a larger range of A:AK , etc. (With A:A being text). Since I've posted this, I have had some success by using Filter(), but the problem I'm not sure how to solve is finding the last 12 values before a blank cell.
Example of Data 1
Example of Data 2
Hopefully this helps explain the situation and I appreciate everyone for help.

Resources