Skip to main content

Need help with complicated date based formula

  • May 16, 2024
  • 2 replies
  • 28 views

Forum|alt.badge.img+3

Hi all - I need help with this formula as I was able to use Chat GPT to get me close to where I need to be, but it still doesn't work.

Can someone rewrite this formula so it works: 

IF({End Date} > "7/1/2024" {Latest Revenue Projections} ("6/30/2024"{Start Date}+1({End Date} {Start Date}+1) , "")

2 replies

Brian_Sweeny
Forum|alt.badge.img+5
  • Participating Frequently
  • May 16, 2024

Hi! Can you explain what you are trying to do here?


Dan_Montoya
Forum|alt.badge.img+17
  • Employee
  • May 16, 2024

It looks like you are trying to calculate the number of days to determine the % of the quarter complete or something similar to that.  In that case you need to use datetime_diff(start, end, 'days').

IF({End Date} > "7/1/2024" {Latest Revenue Projections} ("6/30/2024"{Start Date}+1({End Date} {Start Date}+1) , "")

would look something like:

IF({End Date} > "7/1/2024" , {Latest Revenue Projections} * datetime_diff("6/30/2024", {Start Date}, 'days') / datetime_diff({End Date}, {Start Date}) , "")

 

Not sure what the +1 is doing since you didn't provide more detail around.  But to address your question, you need to use datetime_diff to subtract one date from another date.