Conditional formatting google sheets, match date between two dates- mark that row that is matching - date

I am looking for a way to match any date in a column of dates with a bunch of start/end periods at columns next to it. If any match, mark my cell.
I have managed to do this for one row, but I would like it to look at a whole column (or set range ex X6-X10) and compare with a bunch of date-periods in two columns.
Any one with any ideas of how I can do that?
This is what I have come up with so far:
And I am using this formula:
=AND($X$6>=$R$6,$X$6<=$T$6)
But, as I said, this only works for one row today. I would like to look through all rows in the columns.

This formula should work:
=COUNTIFS(X$6:X,">="&R6,X$6:X,"<="&T6)

Related

How can I filter by a group of individual dates in Google Sheets?

I have a group of individual dates on one sheet, and I'm looking for a quick way to filter by each individual date (not the range) on another sheet.
Group of individual dates
Values I'm trying to filter
Thank you.
I tried separating the dates by comma and putting them into the 'filter by - exact date' part of the filter tool. It will only recognize one date, not multiple.
I'm guessing what you may want to do. But if you want to filter by formula your range according to the dates match your second range you can do something like this:
=FILTER (Sheet1!A:O,INDEX(IFERROR (MATCH(Sheet1!A:A,Sheet2!A:A,0))))
Change the ranges accordingly. I used sheet 2 as the set of dates you wanted to filter by

Finding rows with matching id's and the using the date fields in each row to find the time difference in days between them

I have rows of data where up to 3 id's match. I need to try and find the number of days between each of the rows with matching id's using the date field. I am looking to find the number of days between each row in date sequence. So between the first and second row in date sequence, or second and third row but not the first and third row.
So a simplified version of my rows can be seen in the attached image.
image showing 2 ID's with multiple entries. John Smith (highlight yellow) who has 3 entries, two on the same day and one later and Bill Wright who has just two entries on separate days.
The results I would be looking for would ideally be shown in column 4 of the image.
Is there any way I can do this in a formula or pivot table? (basically avoiding VBA) Any suggestions hugely appreciated! Thanks.
This array formula
=IFERROR(B2-INDEX($B$1:$B$9,MAX((A2=$A$1:A1)*ROW($A$1:A1))),0)
will work as long as your data are sorted by date (which your screenshot indicates they are):

Sorting a list according to date with missing date inserts

Sorry for the convoluted title, but I find it to be a convoluted propblem
I have two lists, one of dates and one of counts pr. date.
Like this:
I would like it to end up like this:
where the dates have been moved to their corresponding cell, according to the time between the two dates.
I would prefer it to be doable in Google Sheets, but if thats impossible, Excel would suffice.
Anyone have a clue of how to this?
You can create the sequence of all dates as proposed by #BigBen in the comment using SEQUENCE like this
=SEQUENCE(MAX($A$1:$A$3)-MIN($A$1:$A$3)+1;1;MIN($A$1:$A$3))
And then in the next cell you can insert the following formule
=ArrayFormula(IFERROR(VLOOKUP($C$1:$C;{$A$1:$B$3};2;FALSE)))

How to return a cell value if the date in a range of cells is today in google sheets

I currently have a Google Sheet, with numerous sheets in it, to track contract deadlines for different clients. One of these sheets shows me all of the deadlines in Columns E:M for every contract. Each row is a separate contract.
I'm trying to create a separate sheet that will show me the client's name, found in column A, if a date in columns E:M is Today. That way I can look at one page and see all the clients that have a deadline today. Here is what I tried with no success:
=if('U/C(Dont Edit)'E2:M2=TODAY(),'U/C(Dont Edit)'A2,"")
"U/C(Dont Edit)" is the sheet that shows all of the contracts.
I believe the problem lies when I try to apply "=Today()" to a range(E:M). It seems to work fine if I just use E2=Today(). It looks like I could accomplish my goal using If statements within If statements, but that gets very messy very quickly and I'm hoping there is a better way.
Thanks in advance for your help.
You can do it with the COUNTIF() function per row:
=IF(COUNTIF(E2:M2,TODAY())>0,A2,"")
But I think a better solution is to use the FILTER() function. It will give you a list of names:
=FILTER(A2:A,(E2:E=TODAY())+(F2:F=TODAY())+(G2:G=TODAY())+(H2:H=TODAY())+
(I2:I=TODAY())+(J2:J=TODAY())+(K2:K=TODAY())+(L2:L=TODAY())+(M2:M=TODAY()))
I suggest #dePatinkin's solution (for and additional column, say N, containing the COUNTIF formula from Row2 downwards) in combination with a query (in another sheet):
=query('U/C(Dont Edit)'!A:N,"select * where N is not NULL")
This assumes your existing sheet has the columns labelled.
You might combine the above with Conditional formatting to indicate which column has the date in it (today) that triggered the row selection.

Retrieving value from previous row in calculated column based on condition

I am working on data in Spotfire. The table has 4 columns:
RowID
StudID
IMT
Date
I am trying to insert a calculated column in Spotfire to get the date from the previous row for a specific StudID. The date should not be filled for first entry for a specific StudID since it does not have a previous row.
Please refer to the image for details:
This will be a calculated column using the OVER function, along with Intersect, Previous and the First aggregation.
First([Date]) OVER Intersect(Previous([Date]), [StudID])
It reads: over the intersection between (group of) the previous (to the current row) dates (which are the same) and the Student ID's (the same as the current row), give me the first row of that group. In your example, it will only ever return one date for that group, but the formula needs to be able to handle what happens if there are multiple rows. You may also need to think about whether this will happen in your data and what you're going to do about it. I.e.
StudID Date
124-639 6/12/2018
124-639 6/12/2018
124-639 6/14/2018
Building off of JasonJ's answer, it looks like his solution ran into issues when the dates of different StudIDs overlapped with one another.
So I was seeing something along the lines of this:
StudID, Date, Result
A, 10/1/2014,
A, 10/10/2014, 10/1/2014
A, 10/17/2014, 10/10/2014
B, 10/20/2014,
A, 10/21/2014,
B, 10/22/2014,
B, 10/24/2014, 10/22/2014
I created a weird workaround by adding another Calculated Column.
I doubt this is the IDEAL way to do this (I'd bet there's a better OVER function, but I couldn't identify it right off), but it looks like it's working.
First Calculated Column (Named [CalcRank]):
Rank(Concatenate([StudID],Year([Date]),If(DayOfYear([Date])<10,"0",""),If(DayOfYear([Date])<100,"0",""),DayOfYear([Date])))
Second Calculated Column:
Max([Date]) OVER (Intersect(Previous([CalcRank]),[StudID]))
Please note, you may have to pad your StudID with 0s to make sure it orders properly, like I did with the Date column.