Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IsDate ArrayFormula

Have just noticed isDate does not work in arrayformula.

Case

Want to filter all values if dates:

enter image description here

Used the formula:

=FILTER(data,ISDATE(data))

Expected result:

8/28/2018

Got:

#N/A

Question

  1. Why? Other checks work in filter (isNumber, isText, isErr).
  2. Workarounds?
like image 230
Max Makhrov Avatar asked Jan 02 '23 22:01

Max Makhrov


1 Answers

  1. Do not know the reason, still curious.

  2. Workaround: =FILTER(data,IFERROR(DATEVALUE(data))) was found here

Note: Workaround will NOT work for dates formatted as:

dd.mm.yyyy

You may use a duck-typed workaround:

=FILTER(data,REGEXMATCH(MID(data,7,4),"20\d{2}"))

Will check if formatted date has a 20XX year string inside.

like image 196
Max Makhrov Avatar answered Jan 05 '23 07:01

Max Makhrov