How to apply array formula to join all the cells in a column and exclude empty cells in google sheets doc spreadsheet - csv

=ArrayFormula(join(",",char(34)&E3:E11&char(34))) This is the formula I have thus far.
It is able to output the values from the ranges I have manually chosen E3 to E11 which are
Nurse
Nurse Practitioner
Physician Assistant
Dialysis
Nurse Anesthetist
Dental Hygienist
Lab Technician
Diagnostic Technician
Medical Records
The formula is able to output them like this:
"Nurse","Nurse Practitioner","Physician Assistant","Dialysis","Nurse Anesthetist","Dental Hygienist","Lab Technician","Diagnostic Technician","Medical Records"
I would like to be able to make the range E3:E so that new values will be automatically outputted when they are added in. But, doing this with the formula I have now just includes a bunch of trailing empty quote values, like this "" because of the blank cells.
How can I exclude blank cells from applying to my ArrayFormula?

try:
=INDEX(JOIN(",",CHAR(34)&FILTER(E3:E,E3:E<>"")&CHAR(34)))

Related

Google Sheets: Conditional formatting in an array based on source column of separate sheet

I have a sheet named Equipment with two columns G "Purchased Date" and H "Installation Date". A separate sheet named December is a calendar that is populated with data from Equipment when the dates match.
In the example below, I3 in December is 12/01/2020
=ARRAYFORMULA(IFERROR(INDEX(Equipment!A2:D,SMALL(IF(I3=Equipment!G2:H,ROW(Equipment!G2:H)-1),1))))
I would like to indicate in December that the data is a "Purchase Date" or an "Installation Date", preferably through conditional formatting (One is red font the other is blue font). The only solution I can think of is to force user to have two separate rows, one for "Purchase Date" and one for "Installation Date". Is it possible to avoid doing this?
Equipment
December
I came up with an answer that you may want to try. But it does involve a helper column for each day of the week. See my sample sheet here. I've used columns AS to AW on the far right for this. In AS, I put this formula:
=ArrayFormula(COUNTIFS(Equipment!$A$2:$A,D5:D,Equipment!$G$2:$G,$D$3))
This does a COUNTIFS in the Equipment tab for records that have the same Project Name as this row, and a purchase date equal to the date for this day of the calendar. This returns a 1 or a 0.
Then conditional formating rules are used to change the Project Name (in column D) to red text if column AS=1 (a purchase date), or blue text if not. If you predefined all of the text in this column as red (or blue) you would only need one CF rule for the whole column, making this easier to set up. You already have CF rules for your date headers, so they could override the default font colour (red or blue) assigned to the column, without needing an additional rule.
Note also that I found an alternative to your formula in D5 (and I5, N5...):
=iferror(query(Equipment!$A$2:$I,"Select A,B,C,D
where (G = date '"& text(D3,"yyyy-mm-dd") & "'
or I = date '"& text(D3,"yyyy-mm-dd") & "') order by A",0))
This returns all of the results for this day, with one formula.

Count the values from a variable column

I have a problem writing down a formula or a script in Google Sheet or Google App Script to find and count the values in a sheet where the number and references to the columns change.
I have a script that copy&paste the Sheet files for the staff shifts of every week from a Drive folder and merge them side by side (in horizontal).
In this sheet that contains all the shifts merged I want to count all the cells of the staff filtered only for handler and picker (column B, K, etc.) according to a specific date (row 3) for every hour.
Example: if today is 28/10/2020 find the right column with the same date in row 3 --> column E, count all the values from row 4 filtered by picker or handler for every hour (10 people at 05 AM).
Do you think that I can implement this with a formula (like a matrix, vlookup, etc.) or should it be written as a Script?
Thank you very much,
Marco
Please use the following
=COUNTA(QUERY({A3:I;J3:R},"select Col"&MATCH(A1,A3:I3)&"
where Col2 matches 'Technician|Picker' "))
Where B1 holds the date you wish to search for (28/10/2010)
Try the below formula. Replace date with your search date.
=COUNTA(INDEX(A4:R14,,MATCH(DATE(2020,10,28),A3:R3)))
This was earlier tagged as excel. This is how to "tackle" this in excel (office 365):
In a clear column use the following formula to get the unique hour-values that are in the column that equal today:
=UNIQUE(FILTER(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)),INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0))<>""))
In the column next to that type the following to get the result of the count of those unique values for that day:
=COUNTIF(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)), FILTER (I:I,I:I<>""))
Where I:I in FILTER (I:I,I:I<>"") needs to be changed into the column you put the first formula.

How do you remove "#REF!" in one sheet linking formula if a cell in another sheet is removed?

I have the following Google Sheet.
Sample
I have an Apps Script code called onEdit(e). When you enter a date into column B of the Qualifications sheet, the Employee is cut and pasted to into Qualifications - Employees Left sheet. That works perfectly but it creates a #REF! issue in the sheet called FormRanger and which is used to form my dropdown in Google Forms and in the other sheets.
The Employees name needs to remain in the spreadsheet so that it can populate the Qualifications - Employees Left sheet for future reference and in case the employee returns. I, however, want the employee's name (now #REF!) removed from the FormRanger sheet.
Would really appreciate some help with the code.
You want Columns A and B of sheet "FormRanger" to always reflect the active employees.
At present, this is done by assigning values to each cell such as =Qualifications!A5 but when an employee is deleted, this leaves #REF on "FormRanger".
An alternative is to make the values in Columns A and B dynamic by using a QUERY command.
=query(Qualifications!A5:D,"select A, D",0)
To use the formula
delete the entire contents of cells in Columns A and B or "Form Ranger" (1000 rows).
insert the formula in cell A2 of "FormRanger"
The formula will populate both columns A and B, and will also fill down the appropriate number of rows.
When an employee is deleted, the values will automatically adjust.

If Function isn't working properly

I'm trying to pull out only Salary Earnings from a Payroll tab to "Salary Earnings" column on Unique payroll tab using this "IF" function: =IF(Payroll!F2="Salary", Payroll!G2, " ") but for some reason it's skipping the salary on the same date as bonus.
I even tried the below one, and it's leaving D5, D6, and D7 empty.
=IF(AND(Payroll!F2="Salary", Payroll!C2=UniquePayPeriod!C2), Payroll!G2, " ")
Can anyone help please?
Thanks!
If I assume you're dragging the formula down in your UniquePayPeriod spreadsheet, then you may not be getting the "right" output, but you're getting the "accurate" output.
D5 will be blank because F5 is "Bonus", failing your if condition
D6 will be blank because Payroll!C6 is not equal to UniquePayPeriod!C6
D7 will be blank because Payroll!C7 is not equal to UniquePayPeriod!C7
This is happening because your Payroll sheet is listing Bonuses on separate line items with the same dates; after the first listing of a bonus, your Check Dates on your UniquePayPeriod sheet will not align with your Check Dates on the Payroll sheet
What you'll need to do is use Match and Index to look up the condition of ID, Check Date, and Salary, and then ID, Check Date, and Bonus.
This is the formula you need to put in your Salary Earnings Column
=IFERROR(INDEX(yourPayrollTable,MATCH(B2&C2&"Salary",yourIDColumn &
yourCheckDateColumn & yourEarnTypeColumn,0),7),"")
This is the formula you need to put in your Salary Earnings Column
=IFERROR(INDEX(yourPayrollTable,MATCH(B2&C2&"Bonus",yourIDColumn &
yourCheckDateColumn & yourEarnTypeColumn,0),7),"")
yourPayrollTable should be the range of data on the Payroll sheet
that has all your payroll information (Payroll!A2:G100 for example)
yourIDColumn should be the range of data on the Payroll sheet
that has all the IDs (Payroll!A2:A100 for example)
yourCheckDateColumn should be the range of data on the Payroll sheet
that has all the Check Dates (Payroll!C2:C100 for example)
yourEarnTypeColumn should be the range of data on the Payroll sheet
that has all the Earn Types (Payroll!F2:F100 for example)
These formulas are Array Formulas, so please make sure you press Ctrl+Shift+Enter after entering the formula and dragging it down, instead of just pressing Enter.
This can be a bit confusing so please comment if it does not make sense what you need to do

Google Spreadsheet Populating Cells in Other Sheet Based on Value

Am new to Google Docs, but have to create a cumulative report of comments that are flagged as positive or negative. I have 6 worksheets that ideally would populate to a single report, but I could create 6 individual reports for now.
In the source sheet, ColA is a numeric code identifying the category. Col B is the category description; Col C are the notes from one person; Col D is the code to identify it as positive or negative; Cols E and F are the notes from a 2nd person; G/H from a 3rd, etc.
The report sheet needs to transpose the vertical comments by category with the positive comments for all persons for the first category in Col G, the negative comments for the 1st category in Col H, etc for all 6 categories.
I was able to manually create this report using the following formula to extract the Positive comments from column C:
QUERY(EntrySheet1!C5:D15;"select * where D='P'")
But, it's pretty tedious to copy the formula laterally and vertically to accommodate all 6 categories and all 6 note takers.
So, my questions are whether or not there is an easier way to extract the information the way I need to report it. Also, is there a way to use something like Excel's Indirect function where I could use the concatenate function to build the formulas and the Indirect to evaluate that function. My thought here is that I could have an entry cell where I would identify which cumulative report I wanted to view by simply updating the cell. An alternative would be to load the data into an array and use a script to populate a static cumulative report. Real-time updating with formulas would be ideal, but creating a static report that is created from a script is acceptable. My biggest concern is the manual effort to update the formulas since they are sheet specific.
Use Google Spreadsheet INDIRECT function.
See the Google spreadsheets function list:
INDIRECT(reference)
Returns the reference specified by a text string. This function can also be used to
return the area of a corresponding string. Reference is a reference to a cell or an
area (in text form) for which to return the contents.
You might be able to feed the results of indirect into your query.