To convert a date to 3-character text for the day of the week, one uses =Text([cell_with_date],"ddd") and gets a 3-character representation of the day of the week.
If the function is placed in B2 and D2 contains 08/18/2021, then B2 would display Wed .
Suppose the cell (D2 in the example) is blank. How does one test to see if the source cell is blank and cause the target cell to be blank? I tried an IF test and got lost in the syntax: =IF(D2="","", ????) I couldn't figure out how to put the =Text test in the formula.
Date to Day Week
-
- UraniumLounger
- Posts: 9284
- Joined: 13 Feb 2010, 01:27
- Location: Deep in the Heart of Texas
Date to Day Week
Bob's yer Uncle
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs
(1/2)(1+√5) |
-
- UraniumLounger
- Posts: 9284
- Joined: 13 Feb 2010, 01:27
- Location: Deep in the Heart of Texas
Re: Date to Day Week
Got it sorted.
The answer is . . . =IF(some_cell<>"",text(some_cell,"ddd"),"") meaning if the vale in 'some_cell" is not blank, create the 3-character day of week name in this cell (where the formula exists) otherwise make this cell blank. Or in use say cell B40 has the formula: =IF(D2<>"",text(D2,"ddd"),""). If cell D2 is blank make B2 blank else convert the data in D2 (presumed to be a date) to the 3-character day of the week for that date.
Not the best of solutions, perhaps; but it works because column D is formatted to only contain dates in the format mm/dd/yyyy. It doesn't take into account what would happen if a cell in column D does not contain a date in that format.
The answer is . . . =IF(some_cell<>"",text(some_cell,"ddd"),"") meaning if the vale in 'some_cell" is not blank, create the 3-character day of week name in this cell (where the formula exists) otherwise make this cell blank. Or in use say cell B40 has the formula: =IF(D2<>"",text(D2,"ddd"),""). If cell D2 is blank make B2 blank else convert the data in D2 (presumed to be a date) to the 3-character day of the week for that date.
Not the best of solutions, perhaps; but it works because column D is formatted to only contain dates in the format mm/dd/yyyy. It doesn't take into account what would happen if a cell in column D does not contain a date in that format.
Bob's yer Uncle
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs
(1/2)(1+√5) |