I'm working in Google Sheets and I am trying to determine if any value of dates listed in the column is equal to Today's Date.
I have tried using the COUNTIF formula the ISDATE formula and the IF formula against the value of TODAY() and nothing seems to be working right.
=IF('Invoices-Quickbooks-Data'!L:L,ISDATE(TODAY()),true)
This formula actually works the best for me. I would expect it to calculate if any of the values equal Today's Date. Ironically this tells me that the answer is TRUE even when none of the dates actually match Today's date so I am not sure what is going on.
First, the reason why your formula is always returning true is because ISDATE(TODAY()) will always return true (when is today not a date?) and furthermore, you can't use an IF statement like that to query a whole column. The first argument to IF is a condition, and a column range is not a condition.
To apply a function over a range, you want to use an ARRAYFORMULA. Here is how you would check a range of cells to see if any value in the column (or range) contains a date equal to today:
=IFERROR(VLOOKUP(TRUE,ARRAYFORMULA(IFERROR(DATEVALUE(A:A)=TODAY(),FALSE)),1,FALSE),FALSE)
Just replace A:A with the range you want to check. The return of an ArrayFormula is an array, which is why I have to use VLOOKUP to check for any TRUE values inside it.
Advanced solution:
A really cool feature in sheets is the query() function, which essentially lets you run a SQL-like query over a range of cells. I like it because it makes formulaes very readable - for example, the entire ARRAYFORMULA solution above can be replaced with:
=IFERROR(QUERY('Invoices-Quickbooks-Data'!L:L,"select count(L) where dateDiff(L,now()) = 0 label count(L) ''",-1) > 0,FALSE)
you can check it with just simple IF formula:
=ARRAYFORMULA(IF(LEN(A2:A), IF(A2:A=TODAY(), TRUE), ))
=ARRAYFORMULA(IF(A2:A=TODAY(), TRUE, ))
Related
this might be an easy fix but I just can't figure it out. I'm trying to get this IF statement, if the cell is not FALSE to return value, else to return a certain string. I've tried a couple of ways but I can't make the right combination. And I have a similar issue with excluding the FALSE value from a UNIQUE search statement.
This is the sample. Sorry if I'm missing on smth very obvious
Regarding your concern in setting a value if the cell is NOT FALSE, you can use this formula in Row 2:
=arrayformula(if(A2:A<>"",if(A2:A=FALSE,"Blank",iferror(year(to_date(datevalue(A2:A))),"No year found")),""))
What it does?
Check if cell value is FALSE, If yes, set cell value to "Blank", else convert the date string to value using datevalue(). Then use to_date() to convert date value into a date object. Use year() to get the year. Use iferror() to set a default value if the formula encountered an error (when your string is not a valid date string)
Loop each row using arrayformula()
Output:
Regarding filtering your data without FALSE:
=filter(A2:A,A2:A <> FALSE)
What it does?
Using filter(), filter the data if the cell value is not FALSE
Output:
Note:
You can also use UNIQUE() once you filter your data
=unique(filter(A2:A,A2:A <> FALSE))
I'm want to conditionally format A3:A if the value entered in A3:A already appears in B3:B, which contains CSV, >1 time.
(A3:A will be CONCATENATED to B3:B, so the value will automatically appear at least once.)
Basically, if the value is not already present, there will be no formatting and I know to go ahead and add (leave it). If it is present, format the cell to alert me not to add (or delete). There may be numerous values in some cells and not so easy to glance to see if the value in question is already present.
I attempted to use REGEXMATCH, but not really sure how to switch the TRUE to a numeric value.
=IF(LEN(A3),REGEXMATCH(B3,A3),)
I've also found other formulas using COUNTIF and COUNTA that perform a similar action, but none that consider CSV.
My sheet
custom formula for CF:
=ARRAYFORMULA(REGEXMATCH(A3,TEXTJOIN("|",1,TRANSPOSE(QUERY(QUERY(TRANSPOSE(TRIM(
SPLIT(B3,","))), "select Col1,count(Col1) group by Col1"),
"select Col1 where Col2 > 1", 0)))))
I have a formula that will work when applied to just one cell but stops working when I try to make it an array formula so it applies down the entire column.
I am trying to check if the date in column E is today and if column A is true or false. Based on that, I want column C to read true or false.
I have tried to apply the column to each cell individually by dragging it down, and that works fine. But it will not work with an ArrayFormula.
=AND(INT(E2:E)=TODAY(),A2:A=FALSE)
When I apply ArrayForumla the result comes back FALSE even when it should be positive.
I expect it to automatically populate each cell in the column with that formula and return the correct TRUE/FALSE result.
G2:
=ARRAYFORMULA(IF(LEN(E3:E), E2:E+F2:F, ))
H2:
=ARRAYFORMULA(IF((INT(E2:E)=TODAY())+(INT(G2:G)=TODAY()), A2:A, ))
Please try:
=ArrayFormula((A2:A)*(int(D2:D)=TODAY())>0)
I am attempting to count the sum of a column populated by a RegExMatch function but using a COUNT function, eg =COUNT(F2:F100).
The function that populates a cell with '1' is:
=IF(RegExMatch($E2,"SKU123"),"1","")
I can see '1' appear many times in the column but when I attempt to sum the column I get a zero answer.
Any suggestions for how I perform a better RegExMatch (or alternative) or way to sum the column?
Change your formula from
=IF(RegExMatch($E2,"SKU123"),"1","")
to
=IF(RegExMatch($E2,"SKU123"),1,"")
and will work.
COUNT returns the number of numeric values in a dataset, and you were filling with strings. SO in your version it will always return 0.
I have 2 column; ID CODE, value
Remove duplicates function will remove the examples with the higher value and leave the lower one. Is there any way to remove the lower ones? The result I expected was like this.
I've tried Buffer Table function before but it doesn't work. Seems like Buffer Table just works with date-related data (newest-latest).
You could use SUMMARIZE which can be used similar to a SQL query that takes a MIN value for a column, grouped by some other column.
In the example below, MIN([value]) is taken, given a new column name "MinValue", which is grouped by IDCode. This should return the min value for each IDCode.
NewCalculatedTable =
SUMMARIZE(yourTablename, yourTablename[IDCode], "MinValue", MIN(yourTablename[value]) )
Alternatively, if you want the higher values just replace the MIN function with MAX.