Date to Day Week

User avatar
BobH
UraniumLounger
Posts: 9218
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Date to Day Week

Post by BobH »

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.

:cheers: :chocciebar: :thankyou:
Bob's yer Uncle
(1/2)(1+√5)
Intel Core i5, 3570K, 3.40 GHz, 16 GB RAM, ECS Z77 H2-A3 Mobo, Windows 10 >HPE 64-bit, MS Office 2016

User avatar
BobH
UraniumLounger
Posts: 9218
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Re: Date to Day Week

Post by BobH »

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.
Bob's yer Uncle
(1/2)(1+√5)
Intel Core i5, 3570K, 3.40 GHz, 16 GB RAM, ECS Z77 H2-A3 Mobo, Windows 10 >HPE 64-bit, MS Office 2016