I am trying to implement the following code in a calculated column named [Valid] in a document library in modern SharePoint online.
=IF([Valid Until]-TODAY()>=0,"Valid","Expired")
It works fine as long as a document file is uploaded to the library. However, when I upload a folder containing different documents, this does not work and the value displayed in the [Valid] column for the folder is always "Expired". This could be because when I upload a folder the [Valid Until] column does not take any value as input because it is not needed as opposed to a file. How can I solve this issue and display nothing in the [Valid] column when I am uploading a folder?