Question: I have this table :

[![enter image description here](https://i.stack.imgur.com/0zqIF.png)](https://i.stack.imgur.com/0zqIF.png)

column **F** is my data and column **H** is to check if column **F** has **N/A** error. In **H1** i use this formula :

```
ifna(F1,"error")

```

Seems to work fine. But in the 2nd row when it check the date , it returns a number instead of a date.
How can I fix this ?

Answer: 
Use [filter views](https://support.google.com/docs/answer/3540681) to let view-only users sort the sheet. This feature lets multiple simultaneous users sort and filter the sheet without disturbing each other.

For additional ease of use, insert links in the frozen section of the sheet to easily switch between filter views, instead of having to go to **Data > Filter views** to switch. See the [Filter views example](https://docs.google.com/spreadsheets/d/1ME5b4J6fQa8RRainxGtQkwTKFCg96N8_k6kCe8ABNyk/edit#gid=2048818001&fvid=336145647) spreadsheet for an illustration.

The links look like this:

`=hyperlink("#gid=2048818001&fvid=336145647", "Show all")`

...where `gid=...` identifies the sheet and `fvid=...` identifies the filter view. You can get these identifiers from the browser address bar when a filter view is active.
In case you cannot find a solution using formulas I will give a solution using the following code:

```
function onEdit(e) {  
  const as = e.source.getActiveSheet();
  const row = e.range.getRow();
  const col = e.range.getColumn();
  const lc = as.getLastColumn();
  const lr = as.getLastRow();
  const rg = as.getRange(2, 1, lr, lc);
  let asc = true;
  let val = as.getRange(row, col).getValue();
  if (as.getName() == 'Sort' && row == 1 && val.match(/↓/) != null) {
    asc = false;
    rg.sort({ column: col, ascending: asc });
  } else if (as.getName() == 'Sort' && row == 1 && val.match(/↑/) != null) {
    asc = true;
    rg.sort({ column: col, ascending: asc });
  }
}

```

Configure data validation in the header's cells from the lists "PLAYERS ↓, PLAYERS ↑", "AT BATS ↓, AT BATS ↑", "HITS ↓, HITS ↑".