I want to get Day name from a specific date on Google Spreadsheet (also tried on Microsoft Excel Online).

---

I have written specific date on a cell B1: `2020-03-31`

then custom number format it as: `yyyy-mm-dd`

I also have a formula on it's side in A1 `=day(B1)` the result is `Tuesday`. This is **correct**.

But when I enter a new date: `2020-04-01` the result of the formula have gone wrong.

---

[screenshot of the issue](https://i.stack.imgur.com/225D3.png)

What's causing this and how to solve it? Did I use the wrong formula?

Thanks.

---

*edit: found the issue it was because column of A/C was formatted as number of day of month, not the date itself.*

correct formula would be: `=TEXT(B1,"dddd")`