Using ArrayFormula with CountIF and IsBlank - google-sheets

I have a Google Form that asks a series of Yes/No questions. I'm trying to sum the number of Yes responses in each row as a new submission is entered.
Here's what I have, that doesn't work.
=ARRAYFORMULA(if(isblank(E$2:E),"",(COUNTIF(A2:D2,"yes"))))
It works for one cell if I remove isBlank, and just do this:
=ARRAYFORMULA(COUNTIF(A2:D2,"yes"))
But then I've lost the benefit of using "isBlank" to autopopulate for new form submissions. I'm really trying to avoid doing this with hidden sheets.

In E1 try this formula
={"Count";arrayformula(if(len(A2:A), mmult(--(B2:D="Yes"), transpose(B1:D1^0)),))}
Change range to suit.

=ARRAYFORMULA((IF(A2:A<>"",MMULT(--(A2:D="yes"),ROW(A1:A4)^0),"")))

Related

IF statement with Vlookup based on condition

I am currently refining my Google sheet for orders our company receives, but would like some help in creating a condition to an VLOOKUP formula.
To keep the sheet clean, text only appears on input of L column.
We have a second sheet with a simple costing.
This is the formula;
=IF(CONCATENATE(L371)="","",VLOOKUP(L371,COSTING!F:G,2,false))
However, this works for only one supplier at the moment.
Is there a way of adding a condition to take into account a second cell on the main sheet?
Example;
Adding this into the VLOOKUP ...
If X371 = 'SUPPLIER NAME1' look here (L371,COSTING!F:G,2,false), If X371 = 'SUPPLIER NAME2' look here (L371,COSTING!M:N,2,false)
Still learning formulas, so haven't quite mastered how to combine statements.
Any suggestions?
Try
=IF(L371="","",if(X371="SUPPLIER NAME1",vlookup(L371,COSTING!F:G,2,false),If(X371="SUPPLIER NAME2",VLOOKUP(L371,COSTING!F:G,2,false))))

How can I use the COUNTA in ArrayFormula?

I've been trying to use ArrayFormula & COUNTA functions to achieve the result below:
I want the result to be like this
I want to count the number of the words in each field, and I am trying to drag formula down automatically when the sheet has new fields. I came up with this formula: =ARRAYFORMULA(COUNTA(transpose(split(join(char(10),$A2),char(10)))))
But when I add in new fields, the automation doesn't work. I also try to replace $A2 with $A2:A but I still couldn't automate it.
The current situation
Any thoughts would be appreciated!
Here is something that may work for you if you put this in B2:
=INDEX(IF(A2:A="","",LEN(REGEXREPLACE(A2:A&CHAR(10),"\S+(\n)","1"))))

I am trying to use vlookup as a conditional formatting formula

I have a Google sheet that has a roster of people. I want the sheet to automatically color code people on the roster tab that are also present on a second tab that lists people who have dietary restrictions. I thought that conditional formatting would be the way to go, but I can't get the formula to work. I also can seem to get the conditional formatting formula to be relative based on the row. This is the formula that I have so far. A5 is the first cell that contains the person's ID number. The ID numbers are listed in column A on the "Dietary Restrictions" sheet.
=NOT(ISNA(VLOOKUP(A5,'Ghost Students'!A:H,1,FALSE)))
You want to highlight values from A5:A in one sheet (let's call it Roster) if they are present in column A from another sheet (Dietary restrictions).
Since conditional formatting formulas cannot reference other sheets, you have to use INDIRECT in order to reference that.
You can then use MATCH to check if the value is present.
Your formula could be like this:
=MATCH($A5,INDIRECT("'Dietary restrictions'!A2:A"),0)
Output:
Sheet Roster:
Sheet Dietary restrictions:
How about making vlookup formula grabbing data about dietary conditions from another sheet, and then putting conditional formatting.
You can hide information about dietary conditions if you want and apply conditional formatting based on hidden column:
Just tried. Conditional formatting works with hidden columns too.

Highlight rows with unique values when compared to a different sheet

I have two sheets:
The first is the Master Sheet of responses to a survey.
The second will be an Update Sheet auto-generated from the new responses.
New responses can be either entirely new rows or edits/updates to previous entries.
I am trying to create a Conditional Formatting rule to auto-highlight any rows in the Update Sheet which do not match the corresponding rows in the Master sheet.
(A row "does not match" when it shares the same Respondent ID number as the Master sheet row but contains different information in the following cells.)
I'm also trying to make it ignore any empty cells.
I created named ranges: "Master" and "Update" on each sheet respectively.
Here's an image of what I'm trying to accomplish:
I'd like to accomplish this without scripts or using a helper column if possible.
Any help from you genuine experts out there would be greatly appreciated!
And here's the Demo Sheet for reference.
So far I have tried to use INDIRECT to accomplish the cross-sheet highlighting (below). However, that didn't work so I'm obviously doing something wrong.
CONDITIONAL FORMATTING:
- Apply to Range: A3:A200,F5:F200
- Custom Formula: =ISNA(match(A3,INDIRECT("Master!F5:AS"),0))
Update #2:
With help from #I'-'I I've been able to get closer with:
CONDITIONAL FORMATTING:
Apply to range: A3:F200
Custom Formula: =and(isna(match($A3,INDIRECT("Master!F5:F"),0)),not(isblank($a3)))
However, while it now highlights the "New Data" rows, it ignores the "Updated Data" row which has the same Respondent ID but different data in the following cells.
Any suggestions on how to rectify this would be appreciated!
Conditional formatting custom formula applied to range A3:F200:
=IF(LEN($A3),IFERROR(SUMPRODUCT(QUERY(INDIRECT("Master!F5:J"),"where F = "&$A3&" limit 1")<>$A3:$E3),1),)
HTH
Adam
With help from #I'-'I I now have the following solution, which works perfectly. :
=AND(NOT(ISBLANK($A3)),OR(IFERROR(ARRAYFORMULA(VLOOKUP($A3,INDIRECT("MASTER!F5:J"),COLUMN($A$1:$E$1),0)<>$A3:$E3),1)))
#I'-'I provided this explanation:
VLOOKUP to lookup ID(A3) in the master sheet and return the
corresponding 5 columns(5 cells).
VLOOKUP results are compared
against current row's 5 columns(<>A3:E3).
IFERROR to return TRUE if
lookup fails(suggesting NewData).
ISBLANK to ignore blank rows.
AND/OR/NOT Self explanatory. Used to combine TRUE/FALSE in a specific
way to achieve intended result.
The solution by #AdamL also works, but I don't know how to give credit to two answers at the same time.

Google Sheets Custom conditional formatting multiple conditions

I made a spreadsheet in google sheets in my last company which highlighted all my rows based on my qualifying conditions. I can't remember what conditional formatting I used.
I have tried the =IFAND and =AND functions along with others.
This is what I am trying to do:
If column B says DTC, even if something else is also in cell, and the dates are between two ranges I want it highlighted. Then I will have multiple rules that vary in dates and words. I have attached a new demo sheet to help.
https://docs.google.com/spreadsheets/d/1yX_Ohfdz0uRKvOB8hvOpcO2sb5dSaAP6Zw-aR_HzK2E/edit?usp=sharing
The formula I have in there now is =AND($B2="DTC",E$2>=DATE(2017,10,1),E$2<=DATE(2018,10,1))
To find both DTC and DTC-DCL with a wildcard try using if with search like this:
=if(and(search("DTC*",$B2),$E2>=date(2017,10,1),$E2<=date(2018,10,1)),"true","false")

Resources