Skip to main content
Solved

Pay schedule calculating dates

  • August 24, 2022
  • 5 replies
  • 41 views

I was tring to modify a formula DATEADD({Start Date},13,‘days’) to find the end of the month but since months have differing amounts of days I wasn’t sure how I could do that. Bascially, I want the formula look at the start date and then output the last date in that month. So a start of 9/1/22 would equal 9/31/22, etc. Thanks in advance!

Best answer by TheTimeSavingCo

Hey @Erik_Peterson, this should do what you’re looking for I think:

DATEADD(
  DATEADD(
    DATETIME_PARSE(
      DATETIME_FORMAT(
        Date,
        "01 MM YYYY"
      ),
      "DD MM YYYY"
    ),
    1,
    'months'
  ),
  -1,
  'days'
)

5 replies

TheTimeSavingCo
Forum|alt.badge.img+31
  • Brainy
  • 6463 replies
  • Answer
  • August 25, 2022

Hey @Erik_Peterson, this should do what you’re looking for I think:

DATEADD(
  DATEADD(
    DATETIME_PARSE(
      DATETIME_FORMAT(
        Date,
        "01 MM YYYY"
      ),
      "DD MM YYYY"
    ),
    1,
    'months'
  ),
  -1,
  'days'
)


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • 9808 replies
  • August 25, 2022

One key thing to note here is to leave GMT turned on in the formatting preferences for the formula field.


  • Author
  • New Participant
  • 4 replies
  • August 25, 2022

ok this awesome, but I’ve got something incorrect b/c I’m getting an error. I do see you were using a euro format date and I’m using a US based date format. Even when I swap the DD & MM in the formula it doesn’t seem to work. See attached screenshot.


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • 9808 replies
  • August 25, 2022

ok this awesome, but I’ve got something incorrect b/c I’m getting an error. I do see you were using a euro format date and I’m using a US based date format. Even when I swap the DD & MM in the formula it doesn’t seem to work. See attached screenshot.


“Start of Period” is a field name, so it needs to be in {curly brackets}.

That piece of information was missing from @Adam_TheTimeSavingCo’s formula above.


  • Author
  • New Participant
  • 4 replies
  • August 25, 2022

“Start of Period” is a field name, so it needs to be in {curly brackets}.

That piece of information was missing from @Adam_TheTimeSavingCo’s formula above.


oh duh! Thanks so much!