Count cells if they have date information - google-sheets

I would like to get a count of my cells that have date information.
The format is: ['2020-12-19T00:00:00.939Z', '2020-12-19T00:45:20.499Z']
However, the rest of the cells in that column have [] - not blank, so I can't just do a COUNTIF(A1:A100,"*"). I would like to know how I can format this COUNTIF statement to grab only the cells with date and time data, because also this date could range from any day in the last year. I am using Google Sheets, the latest version.

You can take advantage of the "short" nature of the cells you don't want counted:
sumproduct(--len(A1:A100)>2)
This assumes that you have either have date data or cells like [].

You can try this:
=sum(Arrayformula(if(Substitute(A1:A12,"[]","")="",0,1)))
Substitute cells without date "[]" with empty cell ""
Check if cells are empty set to 0 or 1
use arrayformula() to apply formula to all cell rows
get the sum of the arrayformula() which will give you the count of non-empty cells in your range

try:
=INDEX(COUNTA(IFNA(SUBSTITUTE(A1:A100; "[]"; ))))

Related

SUMIF function adding up time with criteria in another cell (date)

Say I have to sum up the cells in column I if their corresponding cells in column B >= the value in specific cell, E5.
I've tried SUMIF(I9:I12,"<="&E5,B9:B12) and it didn't work. Actually the result is 4307280:00.
Column B is formated to dd-mmm.
E5 cell is formated to dd-mmm.
Column I is formated to [hh]:mm.
result cell is formated to [hh]:mm.
How do you fix it so that the criteria of the SUMIF function involves the value in a specific cell? I'd like to set it this way because I have to add up the hours up to and including a specific date.
Thank You

How do i fill ONE cell with a range of dates between a start and end date

I have a formula which calculates the difference between a start and end date, but each date is displayed in a separate cell. I need all the dates to be in one cell, separated by ",". I know the textjoin() formula can be used for this to a point, but i don't know how to get it to work from dates which aren't already in cells.
Here is what I have already.
the formula in the C2 is =A2+1 and the formula in the cells below that is =IF($A$2+ROW(A2)>=$B$2-1,"",C2+1)
With Microsoft-365 you may use below formula-
=TEXTJOIN(", ",TRUE,TEXT(DATE(YEAR(A2),MONTH(A2),SEQUENCE(DAY(B2)-DAY(A2)-1,,DAY(A2)+1)),"M/d/yyyy"))

Google Sheets show rows with multiple matching cells

I'm needing a formula that gives me the value of the "I" cell if other cells in the row match specific values.
For instance, based on the image I've linked below, if I looked for the results of rows where B=5, C=2, D=2, E=1, and H=F, it would give me the I cell values for rows 12 and 15 (3.03 and 3.63).
Maybe:
=QUERY(A:I,"SELECT I WHERE B=5 and C=2 and D=2 and E=1 and H='F'")
Untested as I can't be bothered to key in what you did not bother to provide as text.

Retrieve value of cell below, based on horizontal search of cell rows above

I'm currently using Google Sheets. I have a spreadsheet that has a horizontal row of dates at the top. I'm attempting to search the horizontal date row for TODAY, and then return the value of a cell vertically below that header. So if TODAY's date is found in "H1" then return the value of "H24", if TODAY's date is found in "Y1" return the value of "Y24" etc and so on.
I've tried =vlookup and =hlookup, but I can't get and semblance of results that aren't an error.
Any help at all would be appreciated, as I'm definitely an Excel/Sheets novice.
Does this formula work as you want:
=FILTER(A24:Z24,A1:Z1=TODAY())
If the current data is in cell H1 then the formula should output the contents of cell H24

Google Sheets - How to highlight cells in a row that match values from other cells?

I have a row of values (say 1-10)
At the beginning of the rows I have 2 numbers generated from dates from other cells that represent week numbers. (eg, 3 and 9)
I want my row to highlight all the numbers from 1-10 that are between the values from the week number cells. (eg the cells with numbers 3,4,5,6,7,8 and 9 will automatically turn a colour (say green))
I've tried the conditional format, using the "between" values.
It doesn't work.
If I just type the numbers into the format box, it will work, but the problem is I need it to refer to the value in the cell NOT a number I type in, because there is a likelihood that the dates could change, which will affect the value shown in week number cell, so I need it to work automatically and not require me to go through every single row changing values for the formatting.
Is this even possible on sheets?
Thanks in advance, I am hoping I've just overlooked something simple.
Use a custom function for conditional formatting. For instance, if the columns you describe are in Row 2, this function will evaluate "TRUE" for numbers that are >= A2 and <= B2:
=AND(C2>=$A2,C2<=$B2)
Select the range of cells you wish to create a conditional format for; C2..L2, say. Open the conditional formatting dialog, and choose "Custom formula". Enter the formula above; note that itr refers to the top-left corner of the range you wish to apply the formula to - Sheets will automatically adjust it for the rest of the range, which is why it's important to use absolute references for the first two columns.

Resources