Apply conditional formatting to whole rows only if multiple rows render true? - google-sheets

I have an advertising campaign tracker that have rows for name, jobcode, startdate and endate. Multiple lines have the same job code, but each of them can have a different end date. I need to apply conditional formatting to all rows that have an enddate that has passed – but only if the end date has passed for all rows with the same jobcode. I have searched this forum and various places online without luck, I really would appreciate your advice on this.
I have created a sample sheet that you may look at. I have created a formatted sample of what I want to achieve at the bottom. Feel free to play on the top one.
Sample Spreadsheet
Thanks in advance!

This formula will work when applied to A3:G8 (or further down the spreadsheet):
=countifs($D$3:$D$8,$D3,$G$3:$G$8,">="&today())=0
the $D in $D3 is to keep the formatting formula locked on column D as it applied across columns A:G.
Use this in the Custom Formula option of the Conditional Formatting

Related

Creating headers (and footers) in the middle of returned query data with Google Sheets

I have a table of data that I want to turn from raw data into something a little 'prettier' and organized to look at.
The data consists of payments made (3 columns: Name, payment amount, and date of payment).
I'd like to present the data so that for each group of dates that are the same there is a header above those rows with the date itself so the user can see these rows of dates are for say 1/14/2023.
Then the next set of rows for say 1/15/2023 would have the header 1/15/2023.
Please see the attached image.screenshot
In columns A - C is the raw data and I don't know how many and which dates there will be a priori. In columns E-G is the desired output.
You can see I'd also like if possible a footer that sums the totals for that day.
Any ideas on how to achieve this? The ideal solution would be such that you could paste raw data into columns A-C and then the data shows up in columns E-G formatted. I'm hoping there's a design pattern for this type of thing before I cobble together a solution.
I've implemented something through Apps Script, but am more interested in learning if there's a way through the formulas provided in Sheets.
I can see this possibly being done with temp/work tables, but am wondering if this is a common problem/solution and would love to get pointed in the right direction. I'm a programmer and have been using sheets for about a year and can write queries and filters and do lots of things but want to learn the right way and not always just do something the first way that pops into my head that works.
try this formula along with a bit of conditional formatting to get the expected output.
Headsup: Set Columns E, F to DATE Type formatting
=LAMBDA(czx,MAP(INDEX(czx,,1),INDEX(czx,,2),INDEX(czx,,3),LAMBDA(ax,bx,cx,{ax,IF(ISNUMBER(ax),{"",""},IF(ax="TOTALS",{"",cx},IF(LEN(ax),{bx,cx})))})))(SORT(LAMBDA(ax,FILTER(ax,INDEX(ax,,1)<>""))({BYROW(UNIQUE(B:B),LAMBDA(bx,IF(bx="",,{bx,bx,0})));A:C;BYROW(UNIQUE(B:B),LAMBDA(bx,IF(bx="",,{"TOTALS",bx,SUMIF(B:B,bx,C:C)})))}),2,1))

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")

Google Sheets: How do I look up multiple values in another sheet?

The scenario I am faced with is kind of an odd one. Basically, I am designing a Google Sheet for work that will allow the employees to log their tech support phone calls and then a report will automatically update on another page, keeping a collective tally of sorts of all the activity on a particular day.
What I am trying to do is write a function that searches another sheet for a particular date and, if that date is found, sum a particular column of values for that day only. There are pictures attached that should help explain the problem.
Basically, I am trying to write a general equation in the cell reading "FALSE" that will look up the date of that row (in this case 1/1/2017) in the "Spendgo Minutes" sheet. If that date were to be found somewhere on that sheet (not necessarily at the top of the sheet), the "Minutes Gained" column would be summed up, but for that date only (not the entire column). Here is my running formula right now that has errors:
=IF(COUNTIF('Spendgo Tally'!$A$3:$A,$B7),'Spendgo Tally'!$G3)
Does anyone know how this might be possible? Feel free to ask any clarifying questions.
You're looking for SUMIF
= SUMIF('Spendgo Tally'!$A$3:$A,$B7,'Spendgo Tally'!$G3:$G)

Google Sheets Formula for Pulling Specific Values in Two Ways

I'm trying to do a couple of different things with a spreadsheet in Google and running into some problems with the formulas I am using. I'm hoping someone might be able to direct me to a better solution or be able to correct the current issue I'm having.
First off all, here is a view of the data on Sheet 1 that I am pulling from:
Example Spreadsheet
The first task I'm trying to accomplish is to create a sheet that lists all of these shift days with the date in one column and the subject ("P: Ben" or S: Nicole") in another column. This sheet would be used to import the data via a CSV into our calendar system each month. I tried doing an Index-Match where it used the date to pull the associated values however I found that I had to keep adjusting the formula offsets in order to capture new information. It doesn't seem like Index-Match works when multiple rows/columns are involved. Is there a better way to pull this information?
The second task I am trying to accomplish is to create a new tab which lists all the dates a specific person is assigned too (that way this tab will update in real time and everyone can just look at their own sheet to see what days they are on-call). However, I run into the same problem here because for each new row I have to change the formula to reflect the correct information otherwise it doesn't pull the correct cell when it finds a match.
I would appreciate any and all information/advice on how to accomplish these tasks with the formula combination I mentioned or suggestions on other formulas to use that I have not been able to find.
Thanks in advance!
Brandon. There are a few ways to attack your tasks, but looking at the structure of your data, I would use curly brackets {} to create arrays. Here is an excerpt of how Google explains arrays in Sheets:
You can also create your own arrays in a formula in your spreadsheet
by using brackets { }. The brackets allow you to group together
values, while you use the following punctuation to determine which
order the values are displayed in:
Commas: Separate columns to help you write a row of data in an array.
For example, ={1, 2} would place the number 1 in the first cell and
the number 2 in the cell to the right in a new column.
Semicolons: Separate rows to help you write a column of data in an array. For
example, ={1; 2} would place the number 1 in the first cell and the
number 2 in the cell below in a new row.
Note: For countries that use
commas as decimal separators (for example €1,00), commas would be
replaced by backslashes () when creating arrays.
You can join multiple ranges into one continuous range using this same
punctuation. For example, to combine values from A1-A10 with the
values from D1-D10, you can use the following formula to create a
range in a continuous column: ={A1:A10; D1:D10}
Knowing that, here's a sample sheet of your data.
First Task:
create a sheet that lists all of these shift days with the date in one
column and the subject ("P: Ben" or S: Nicole") in another column.
To organize dates and subjects into discrete arrays, we'll collect them using curly brackets...
Dates: {A3:G3,A7:G7,A11:G11,A15:G15}
Subjects: {A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}
This actually produces two rows rather than columns, but we'll deal with that in a minute. You'll note that, because there are two subjects per every one date, we need to effectively double each date captured.
Dates: {A3:G3,A3:G3,A7:G7,A7:G7,A11:G11,A11:G11,A15:G15,A15:G15}
Subjects: {A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}
Still with me? If so, all that's left is to (a) turn these two rows into two columns using the TRANSPOSE function, (b) combine our two columns using another pair of curly brackets and a semicolon and (c) add a SORT function to list the dates in chronological order...
=SORT(TRANSPOSE({{A3:G3,A3:G3,A7:G7,A7:G7,A11:G11,A11:G11,A15:G15,A15:G15};{A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}}),1,TRUE)
Second Task:
create a new tab which lists all the dates a specific person is
assigned too (that way this tab will update in real time and everyone
can just look at their own sheet to see what days they are on-call).
Assuming the two-column array we just created lives in A2:B53 on a new sheet called "Shifts," then we can use the FILTER function and SEARCH based on each name. The formula at the top of Ben's sheet would look like this:
=FILTER(Shifts!A2:B53,SEARCH("Ben",Shifts!B2:B53))
Hopefully this helps, but please let me know if I've misinterpreted anything. Cheers.

conditional formatting for newly added rows

Ok, I really have no business working in spreadsheets or any data entry program for that matter. So basically what I am saying is I have no idea how to use much of the formula and script/language features. So any help would be AWESOME!
Heres my issue...
I have two Columns, One contains Conditional formatting (Cell Color) for for 3 variables respectfully. The Other Column is a DropDrown with a list.
I'm hoping to avoid explaining to the person(s) here how to keep applying rules as new Rows are added to the end of the sheet.
Is there an a script someone could dig up for me that (I'm guessing onEdit) will automatically apply my Conditional Formatting and DropDowns the new Rows?
Thank you so much!
I'm not sure this would ever receive another answer so, for the moment considering only I need to to just compare b3-g3>color h3 b4-g4> color h41:
In New Google Sheets, apply your formula to H2:-
=arrayformula(if(G2:G=0,"",if(B2:B=G2:G,"Completed",IF(B2:B>G2:G,"Back Ordered",if(B2:B<G2:G,"Over Shipped")))))
and rules like these in Conditional formatting...:
and I think as new rows are added and data populated in A:G the formulae (both if and Conditional) extend automatically, with no fill where the cell in Column G is 0 or empty.

Resources