Skip to main content
Solved

IF and DATEADD Forumlas together

  • February 17, 2021
  • 7 replies
  • 31 views

Hello,

I am trying to get repeating tasks to work based on their regularity (Daily, Weekly, Monthly) with the IF and DATEADD formula used together. Here is what I have tried:

Can anyone suggest where I am going wrong?

Best answer by Kamille_Parks11

More or less the same formula as above, but made more efficient:

IF(
   AND({Repeating}, {Due date}),
   DATEADD(
      {Due date},
      1,
      SWITCH(
         {Repeating},
         "Daily", "days"
         "Weekly", "weeks",
         "Monthly", "months"
      )
   )
)

7 replies

Forum|alt.badge.img+18
  • Inspiring
  • February 17, 2021

Hi Hazel. Well, it looks like your formula needs another closing right paren. If you want to add in the capabilities for monthly & daily, then add another IF… right after “7, ‘days’)”

,IF(Repeating=‘Monthly’…


  • Author
  • New Participant
  • February 17, 2021

Hi Hazel. Well, it looks like your formula needs another closing right paren. If you want to add in the capabilities for monthly & daily, then add another IF… right after “7, ‘days’)”

,IF(Repeating=‘Monthly’…


Thanks for your help, unfortunately it is still not working for me… this is what I have now as the basic weekly formula:

IF(Repeating = ‘Weekly’, DATEADD ({Due date} ,7,‘days’))

Perhaps I am going wrong elsewhere…


Kamille_Parks11
Forum|alt.badge.img+27

Thanks for your help, unfortunately it is still not working for me… this is what I have now as the basic weekly formula:

IF(Repeating = ‘Weekly’, DATEADD ({Due date} ,7,‘days’))

Perhaps I am going wrong elsewhere…


This is a better use case for SWITCH() than it is for a nested IF() statement since you’re comparing the same thing over and over.

SWITCH(
   {Repeating},
   "Daily",
   DATEADD({Due date}, 1, "days"),
   "Weekly",
   DATEADD({Due date}, 1, "week"),
   "Monthly",
   DATEADD({Due date}, 1, "month"),
)

Forum|alt.badge.img+18
  • Inspiring
  • February 17, 2021

So I just recreated everything to match what you’re doing and it works for me. One thing that stands out to me that I don’t understand is that green circle in the formula window of the screen snip you shared.

You clearly had formula in there before that worked, as I can see the values in lower rows. Is there more of the formula in the window that we can’t see?

I’m stumped.


Kamille_Parks11
Forum|alt.badge.img+27

More or less the same formula as above, but made more efficient:

IF(
   AND({Repeating}, {Due date}),
   DATEADD(
      {Due date},
      1,
      SWITCH(
         {Repeating},
         "Daily", "days"
         "Weekly", "weeks",
         "Monthly", "months"
      )
   )
)

  • Author
  • New Participant
  • February 17, 2021

So I just recreated everything to match what you’re doing and it works for me. One thing that stands out to me that I don’t understand is that green circle in the formula window of the screen snip you shared.

You clearly had formula in there before that worked, as I can see the values in lower rows. Is there more of the formula in the window that we can’t see?

I’m stumped.


Yes, you are right, I have the DATEADD part working but not the Repeating… All sorted now - thank you for all your suggestions!


  • Author
  • New Participant
  • February 17, 2021

More or less the same formula as above, but made more efficient:

IF(
   AND({Repeating}, {Due date}),
   DATEADD(
      {Due date},
      1,
      SWITCH(
         {Repeating},
         "Daily", "days"
         "Weekly", "weeks",
         "Monthly", "months"
      )
   )
)

This worked like a dream - thank you so much!