• Day function

    Author
    Topic
    #352159

    Hello.

    Is there a function that will display the day from a date?
    ie ‘Tuesday’ from ’23/1/01′

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #511392

      Format Cells/Number tab/Custom and enter:
      dddd

    • #511393

      If you just want to display the day of the week, format the cell with the full date

      eg, if the cell conatins “1-jan-01”, select it, the from the menu, Format,Cells, Custom, and enter “dddd”

      If you want to test the day of the week, use the formula in another cell “=weekday(SourceCell)”. That will give you a number 1-7, where 1 = Sunday

      • #511394

        nice one!

        How about a function that calculates the Tuesdays of each month for a couple of years?

        • #511401

          Hi,
          Not sure what you want to do with it, but this will list every Tuesday from now until 21st Jan 2003 in the first column of the first sheet of the active workbook:
          Sub ListTuesdays()
          Dim dblDateSerial As Double, lngDateAdd As Long, intRow As Integer
          dblDateSerial = CDbl(Date)
          intRow = 1
          For lngDateAdd = 1 To 730
          If Application.WorksheetFunction.Weekday(dblDateSerial + lngDateAdd, 1) = 3 Then
          ActiveWorkbook.Sheets(1).Cells(intRow, 1).Formula = CDate(dblDateSerial + lngDateAdd)
          intRow = intRow + 1
          End If
          Next ‘lngDateAdd
          End Sub
          Any use?

    Viewing 1 reply thread
    Reply To: Day function

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: