Ian Martin
Ian Martin

Reputation: 41

Formula for returning a specific date based on input

I have a bit of a puzzle regarding formulas for returning a specific date. At present I have a formula that calculates a date exactly 6 months after the date entered So in column D a date is entered and in column F this formula is set =IF(D196,EDATE(D196,6),"")

This gives me a date exactly 6 months later. What I want to do is have the formula produce the date exactly 6 months minus 1 day. I can get the minus 1 day with the formula =IF(D196,(D196-1),""). I just haven't worked out if it is possible to combine the two together somehow. Or am I barking up the wrong tree and need to have a completely different formula?

Upvotes: 0

Views: 79

Answers (1)

learnAsWeGo
learnAsWeGo

Reputation: 2282

Just throw a -1 at the end of if true formula

 =IF(D196,EDATE(D196,6)-1,"")

If just

  =EDATE(D196,6)-1

is used then if there is no value in D196 excel defaults to 1/1/1900

Upvotes: 1

Related Questions