Home > Net >  Generate formula for compare dates and if condition is met, put custom text
Generate formula for compare dates and if condition is met, put custom text

Time:08-27

I'm working with Google Sheets and Google App Scripts1 for retrieve search results from YouTube - by using YouTube Data API - and write those search results in batch on a sheet.

What I'm trying to accomplish is:

Compare the publish date of the video (values in "C" column) and compare it with the current date (i.e. today's date).

If the video was published today, then, write (on the cells in "E" column) the word: NEW!, otherwise, leave it blank.

I'm looking for a formula that can be set on the cell - rather than just modifying the script and clear the whole column (or a range) everytime the script starts running and rewriting the word if the condition is met1.

I tried modifying these formulas shared on enter image description here


update:

delete everything in E column and use this formula in E1 cell:

={"¿Is New Video?"; ARRAYFORMULA(IFERROR(IF(TODAY()=
 INDEX(SPLIT(C2:C, "T"),, 1), "NEW!", "OLD VIDEO")))}
  • Related